summaryrefslogtreecommitdiff
path: root/spec/models/concerns
diff options
context:
space:
mode:
authorKirill Zaitsev <kirik910@gmail.com>2016-02-06 17:20:21 +0300
committerRémy Coutable <remy@rymai.me>2016-02-11 17:22:11 +0100
commitb123171d3da752c084ef7bfa82dbed962b3e5168 (patch)
tree8a31350c2d57776b6e174ccb03c2556b873a1bc4 /spec/models/concerns
parent9b1dfd3e81855c99b0ccb703d3aecc3f1a7ac7c9 (diff)
downloadgitlab-ce-b123171d3da752c084ef7bfa82dbed962b3e5168.tar.gz
Add new data to project in push, issue, merge-request and note webhooks databugagazavr/gitlab-ce-extend-hooks
- Add `avatar_url`, `description`, `git_ssh_url`, `git_http_url`, `path_with_namespace` and `default_branch` in `project` in push, issue, merge-request and note webhooks data - Deprecate the `ssh_url` in favor of `git_ssh_url` and `http_url` in favor of `git_http_url` in `project` for push, issue, merge-request and note webhooks data - Deprecate the `repository` key in push, issue, merge-request and note webhooks data, use `project` instead
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/issuable_spec.rb23
1 files changed, 12 insertions, 11 deletions
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb
index 8f09ff03a78..600089802b2 100644
--- a/spec/models/concerns/issuable_spec.rb
+++ b/spec/models/concerns/issuable_spec.rb
@@ -69,27 +69,28 @@ describe Issue, "Issuable" do
end
describe "#to_hook_data" do
- let(:hook_data) { issue.to_hook_data(user) }
+ let(:data) { issue.to_hook_data(user) }
+ let(:project) { issue.project }
+
it "returns correct hook data" do
- expect(hook_data[:object_kind]).to eq("issue")
- expect(hook_data[:user]).to eq(user.hook_attrs)
- expect(hook_data[:repository][:name]).to eq(issue.project.name)
- expect(hook_data[:repository][:url]).to eq(issue.project.url_to_repo)
- 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)
+ expect(data[:object_kind]).to eq("issue")
+ expect(data[:user]).to eq(user.hook_attrs)
+ expect(data[:object_attributes]).to eq(issue.hook_attrs)
+ expect(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)
+ expect(data[:object_attributes]['assignee_id']).to eq(user.id)
+ expect(data[:assignee]).to eq(user.hook_attrs)
end
end
+
+ include_examples 'project hook data'
+ include_examples 'deprecated repository hook data'
end
describe '#card_attributes' do