diff options
author | Valery Sizov <valery@gitlab.com> | 2015-12-29 16:07:12 +0000 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2015-12-29 16:07:12 +0000 |
commit | eeba266e3d45f2e82f84bd3aab85195c890efb89 (patch) | |
tree | e3c9d0c6e323f3ba051ec7209f0542e1d1581cab /spec/models | |
parent | a12517466b13150cc6631018b9a7e91ea534e3d9 (diff) | |
parent | d3807328d8ed9be2915f67708b093269bf0b1b9f (diff) | |
download | gitlab-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.rb | 14 |
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 |