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
b4fe5a76
Commit
b4fe5a76
authored
Jun 17, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix UsersGroup specs
parent
fcc1ba5b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/models/users_group.rb
app/models/users_group.rb
+1
-1
spec/models/users_group_spec.rb
spec/models/users_group_spec.rb
+2
-2
No files found.
app/models/users_group.rb
View file @
b4fe5a76
...
@@ -18,7 +18,7 @@ class UsersGroup < ActiveRecord::Base
...
@@ -18,7 +18,7 @@ class UsersGroup < ActiveRecord::Base
attr_accessible
:group_access
,
:user_id
attr_accessible
:group_access
,
:user_id
belongs_to
:user
belongs_to
:user
belongs_to
:
project
belongs_to
:
group
scope
:guests
,
->
{
where
(
group_access:
GUEST
)
}
scope
:guests
,
->
{
where
(
group_access:
GUEST
)
}
scope
:reporters
,
->
{
where
(
group_access:
REPORTER
)
}
scope
:reporters
,
->
{
where
(
group_access:
REPORTER
)
}
...
...
spec/models/users_group_spec.rb
View file @
b4fe5a76
...
@@ -13,10 +13,10 @@ describe UsersGroup do
...
@@ -13,10 +13,10 @@ describe UsersGroup do
describe
"Validation"
do
describe
"Validation"
do
let!
(
:users_group
)
{
create
(
:users_group
)
}
let!
(
:users_group
)
{
create
(
:users_group
)
}
it
{
should
validate_presence_of
(
:user
)
}
it
{
should
validate_presence_of
(
:user
_id
)
}
it
{
should
validate_uniqueness_of
(
:user_id
).
scoped_to
(
:group_id
).
with_message
(
/already exists/
)
}
it
{
should
validate_uniqueness_of
(
:user_id
).
scoped_to
(
:group_id
).
with_message
(
/already exists/
)
}
it
{
should
validate_presence_of
(
:group
)
}
it
{
should
validate_presence_of
(
:group
_id
)
}
it
{
should
ensure_inclusion_of
(
:group_access
).
in_array
(
UsersGroup
.
group_access_roles
.
values
)
}
it
{
should
ensure_inclusion_of
(
:group_access
).
in_array
(
UsersGroup
.
group_access_roles
.
values
)
}
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