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:
authorRobert Speicher <robert@gitlab.com>2016-02-11 00:26:01 +0300
committerRobert Speicher <robert@gitlab.com>2016-02-11 00:26:01 +0300
commit42607a7f175ead8494b12f1c94734eb3b6a16ca1 (patch)
tree90ff5b25e93d0e9fbac5efc67e8ddfc8717fdb65 /spec
parent51998fddcaafdb2c09dc456b877e1ceb709cd17d (diff)
parentd146d9fd8345afbeb12c2f4184d62213023bc98c (diff)
Merge branch 'brammeleman/3047-add-assignee-data-to-isuable-hook-data' into 'master'
Add assignee data to Issuables' hook_data Originally opened at !1633 by @brammeleman. Fixes #3047. Fixes #2475. See merge request !2724
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