summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-12-29 16:07:12 +0000
committerValery Sizov <valery@gitlab.com>2015-12-29 16:07:12 +0000
commiteeba266e3d45f2e82f84bd3aab85195c890efb89 (patch)
treee3c9d0c6e323f3ba051ec7209f0542e1d1581cab /spec/models
parenta12517466b13150cc6631018b9a7e91ea534e3d9 (diff)
parentd3807328d8ed9be2915f67708b093269bf0b1b9f (diff)
downloadgitlab-ce-eeba266e3d45f2e82f84bd3aab85195c890efb89.tar.gz
Merge branch 'upvote_count_to_api' into 'master'
Revert upvotes and downvotes params back to MR API issue https://gitlab.com/gitlab-org/gitlab-ce/issues/3672 See merge request !2212
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/concerns/issuable_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb
index f9d3c56750f..021d62cdf0c 100644
--- a/spec/models/concerns/issuable_spec.rb
+++ b/spec/models/concerns/issuable_spec.rb
@@ -99,4 +99,18 @@ describe Issue, "Issuable" do
to eq({ 'Author' => 'Robert', 'Assignee' => 'Douwe' })
end
end
+
+ describe "votes" do
+ before do
+ author = create :user
+ project = create :empty_project
+ issue.notes.awards.create!(note: "thumbsup", author: author, project: project)
+ issue.notes.awards.create!(note: "thumbsdown", author: author, project: project)
+ end
+
+ it "returns correct values" do
+ expect(issue.upvotes).to eq(1)
+ expect(issue.downvotes).to eq(1)
+ end
+ end
end