Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
1c5a393c
Commit
1c5a393c
authored
Mar 30, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3406 from docwhat/in_projects
Fixed UsersProject.in_projects
parents
52ae0544
b8502cba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
app/models/users_project.rb
app/models/users_project.rb
+1
-1
spec/models/user_team_spec.rb
spec/models/user_team_spec.rb
+20
-1
No files found.
app/models/users_project.rb
View file @
1c5a393c
...
@@ -38,7 +38,7 @@ class UsersProject < ActiveRecord::Base
...
@@ -38,7 +38,7 @@ class UsersProject < ActiveRecord::Base
scope
:masters
,
->
{
where
(
project_access:
MASTER
)
}
scope
:masters
,
->
{
where
(
project_access:
MASTER
)
}
scope
:in_project
,
->
(
project
)
{
where
(
project_id:
project
.
id
)
}
scope
:in_project
,
->
(
project
)
{
where
(
project_id:
project
.
id
)
}
scope
:in_projects
,
->
(
projects
)
{
where
(
project_id:
project
_ids
)
}
scope
:in_projects
,
->
(
projects
)
{
where
(
project_id:
project
s
.
map
{
|
p
|
p
.
id
}
)
}
scope
:with_user
,
->
(
user
)
{
where
(
user_id:
user
.
id
)
}
scope
:with_user
,
->
(
user
)
{
where
(
user_id:
user
.
id
)
}
class
<<
self
class
<<
self
...
...
spec/models/user_team_spec.rb
View file @
1c5a393c
...
@@ -14,5 +14,24 @@
...
@@ -14,5 +14,24 @@
require
'spec_helper'
require
'spec_helper'
describe
UserTeam
do
describe
UserTeam
do
pending
"add some examples to (or delete)
#{
__FILE__
}
"
let
(
:team
)
{
FactoryGirl
.
create
:user_team
}
context
".add_member"
do
let
(
:user
)
{
FactoryGirl
.
create
:user
}
it
"should work"
do
team
.
add_member
(
user
,
UsersProject
::
DEVELOPER
,
false
)
team
.
members
.
should
include
(
user
)
end
end
context
".remove_member"
do
let
(
:user
)
{
FactoryGirl
.
create
:user
}
before
{
team
.
add_member
(
user
,
UsersProject
::
DEVELOPER
,
false
)
}
it
"should work"
do
team
.
remove_member
(
user
)
team
.
members
.
should_not
include
(
user
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment