Merge pull request #1409 from riyad/update-votes
Update votes for issues and merge requests
This commit is contained in:
commit
40eec08c99
17 changed files with 256 additions and 66 deletions
|
@ -12,7 +12,7 @@ describe Issue do
|
|||
|
||||
describe 'modules' do
|
||||
it { should include_module(IssueCommonality) }
|
||||
it { should include_module(Upvote) }
|
||||
it { should include_module(Votes) }
|
||||
end
|
||||
|
||||
subject { Factory.create(:issue) }
|
||||
|
|
|
@ -8,6 +8,6 @@ describe MergeRequest do
|
|||
|
||||
describe 'modules' do
|
||||
it { should include_module(IssueCommonality) }
|
||||
it { should include_module(Upvote) }
|
||||
it { should include_module(Votes) }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,6 +24,13 @@ describe Note do
|
|||
it "recognizes a neutral note" do
|
||||
note = Factory(:note, note: "This is not a +1 note")
|
||||
note.should_not be_upvote
|
||||
note.should_not be_downvote
|
||||
end
|
||||
|
||||
it "recognizes a neutral emoji note" do
|
||||
note = build(:note, note: "I would :+1: this, but I don't want to")
|
||||
note.should_not be_upvote
|
||||
note.should_not be_downvote
|
||||
end
|
||||
|
||||
it "recognizes a +1 note" do
|
||||
|
@ -31,19 +38,19 @@ describe Note do
|
|||
note.should be_upvote
|
||||
end
|
||||
|
||||
it "recognizes a -1 note as no vote" do
|
||||
note = Factory(:note, note: "-1 for this")
|
||||
note.should_not be_upvote
|
||||
end
|
||||
|
||||
it "recognizes a +1 emoji as a vote" do
|
||||
note = build(:note, note: ":+1: for this")
|
||||
note.should be_upvote
|
||||
end
|
||||
|
||||
it "recognizes a neutral emoji note" do
|
||||
note = build(:note, note: "I would :+1: this, but I don't want to")
|
||||
note.should_not be_upvote
|
||||
it "recognizes a -1 note" do
|
||||
note = Factory(:note, note: "-1 for this")
|
||||
note.should be_downvote
|
||||
end
|
||||
|
||||
it "recognizes a -1 emoji as a vote" do
|
||||
note = build(:note, note: ":-1: for this")
|
||||
note.should be_downvote
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue