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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
5d08a5a5
Commit
5d08a5a5
authored
Apr 18, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Note's voting specs don't need to persist to the database
parent
6fdc51f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
spec/models/note_spec.rb
spec/models/note_spec.rb
+16
-18
No files found.
spec/models/note_spec.rb
View file @
5d08a5a5
...
...
@@ -34,48 +34,46 @@ describe Note do
it
{
is_expected
.
to
validate_presence_of
(
:project
)
}
end
describe
"Voting score"
do
let
(
:project
)
{
create
(
:project
)
}
it
"recognizes a neutral note"
do
note
=
create
(
:votable_note
,
note:
"This is not a +1 note"
)
describe
'voting score'
do
it
'recognizes a neutral note'
do
note
=
build
(
:votable_note
,
note:
'This is not a +1 note'
)
expect
(
note
).
not_to
be_upvote
expect
(
note
).
not_to
be_downvote
end
it
"recognizes a neutral emoji note"
do
it
'recognizes a neutral emoji note'
do
note
=
build
(
:votable_note
,
note:
"I would :+1: this, but I don't want to"
)
expect
(
note
).
not_to
be_upvote
expect
(
note
).
not_to
be_downvote
end
it
"recognizes a +1 note"
do
note
=
create
(
:votable_note
,
note:
"+1 for this"
)
it
'recognizes a +1 note'
do
note
=
build
(
:votable_note
,
note:
'+1 for this'
)
expect
(
note
).
to
be_upvote
end
it
"recognizes a +1 emoji as a vote"
do
note
=
build
(
:votable_note
,
note:
":+1: for this"
)
it
'recognizes a +1 emoji as a vote'
do
note
=
build
(
:votable_note
,
note:
':+1: for this'
)
expect
(
note
).
to
be_upvote
end
it
"recognizes a thumbsup emoji as a vote"
do
note
=
build
(
:votable_note
,
note:
":thumbsup: for this"
)
it
'recognizes a thumbsup emoji as a vote'
do
note
=
build
(
:votable_note
,
note:
':thumbsup: for this'
)
expect
(
note
).
to
be_upvote
end
it
"recognizes a -1 note"
do
note
=
create
(
:votable_note
,
note:
"-1 for this"
)
it
'recognizes a -1 note'
do
note
=
build
(
:votable_note
,
note:
'-1 for this'
)
expect
(
note
).
to
be_downvote
end
it
"recognizes a -1 emoji as a vote"
do
note
=
build
(
:votable_note
,
note:
":-1: for this"
)
it
'recognizes a -1 emoji as a vote'
do
note
=
build
(
:votable_note
,
note:
':-1: for this'
)
expect
(
note
).
to
be_downvote
end
it
"recognizes a thumbsdown emoji as a vote"
do
note
=
build
(
:votable_note
,
note:
":thumbsdown: for this"
)
it
'recognizes a thumbsdown emoji as a vote'
do
note
=
build
(
:votable_note
,
note:
':thumbsdown: for this'
)
expect
(
note
).
to
be_downvote
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