Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBram Daams <b.daams@science.ru.nl>2015-10-18 01:11:36 +0300
committerRémy Coutable <remy@rymai.me>2016-02-10 11:40:00 +0300
commitd146d9fd8345afbeb12c2f4184d62213023bc98c (patch)
treed0eb7e32443d4f9c6218c6b04b7d0523f64dca76 /spec
parent93d62bb8afb54f5ad134bdcdc2a39e08d7e7c993 (diff)
Add assignee data to Issuables' hook_data
Diffstat (limited to 'spec')
-rw-r--r--spec/models/concerns/issuable_spec.rb10
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