diff options
author | Bram Daams <b.daams@science.ru.nl> | 2015-10-18 00:11:36 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-02-10 09:40:00 +0100 |
commit | d146d9fd8345afbeb12c2f4184d62213023bc98c (patch) | |
tree | d0eb7e32443d4f9c6218c6b04b7d0523f64dca76 /spec/models/concerns | |
parent | 93d62bb8afb54f5ad134bdcdc2a39e08d7e7c993 (diff) | |
download | gitlab-ce-d146d9fd8345afbeb12c2f4184d62213023bc98c.tar.gz |
Add assignee data to Issuables' hook_databrammeleman/3047-add-assignee-data-to-isuable-hook-data
Diffstat (limited to 'spec/models/concerns')
-rw-r--r-- | spec/models/concerns/issuable_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index 021d62cdf0c..8f09ff03a78 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -79,6 +79,16 @@ describe Issue, "Issuable" do expect(hook_data[:repository][:description]).to eq(issue.project.description) expect(hook_data[:repository][:homepage]).to eq(issue.project.web_url) expect(hook_data[:object_attributes]).to eq(issue.hook_attrs) + expect(hook_data).to_not have_key(:assignee) + end + + context "issue is assigned" do + before { issue.update_attribute(:assignee, user) } + + it "returns correct hook data" do + expect(hook_data[:object_attributes]['assignee_id']).to eq(user.id) + expect(hook_data[:assignee]).to eq(user.hook_attrs) + end end end |