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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
3a0b9e06
Commit
3a0b9e06
authored
Jul 24, 2017
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust tests to work with latest shoulda gem
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
cc577b89
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
8 deletions
+6
-8
spec/models/list_spec.rb
spec/models/list_spec.rb
+0
-6
spec/models/notification_setting_spec.rb
spec/models/notification_setting_spec.rb
+3
-1
spec/models/user_spec.rb
spec/models/user_spec.rb
+3
-1
No files found.
spec/models/list_spec.rb
View file @
3a0b9e06
...
...
@@ -13,12 +13,6 @@ describe List do
it
{
is_expected
.
to
validate_presence_of
(
:position
)
}
it
{
is_expected
.
to
validate_numericality_of
(
:position
).
only_integer
.
is_greater_than_or_equal_to
(
0
)
}
it
'validates uniqueness of label scoped to board_id'
do
create
(
:list
)
expect
(
subject
).
to
validate_uniqueness_of
(
:label_id
).
scoped_to
(
:board_id
)
end
context
'when list_type is set to closed'
do
subject
{
described_class
.
new
(
list_type: :closed
)
}
...
...
spec/models/notification_setting_spec.rb
View file @
3a0b9e06
...
...
@@ -13,7 +13,9 @@ RSpec.describe NotificationSetting, type: :model do
it
{
is_expected
.
to
validate_presence_of
(
:level
)
}
describe
'user_id'
do
before
{
subject
.
user
=
create
(
:user
)
}
before
do
subject
.
user
=
create
(
:user
)
end
it
{
is_expected
.
to
validate_uniqueness_of
(
:user_id
).
scoped_to
([
:source_type
,
:source_id
]).
with_message
(
/already exists in source/
)
}
end
...
...
spec/models/user_spec.rb
View file @
3a0b9e06
...
...
@@ -114,7 +114,9 @@ describe User, models: true do
end
it
'validates uniqueness'
do
expect
(
subject
).
to
validate_uniqueness_of
(
:username
).
case_insensitive
user
=
build
(
:user
)
expect
(
user
).
to
validate_uniqueness_of
(
:username
).
case_insensitive
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