summaryrefslogtreecommitdiff
path: root/spec/models/issue_spec.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-10-05 19:02:50 +0200
committerRémy Coutable <remy@rymai.me>2017-10-09 16:44:47 +0200
commitf070265a6ddd0173c8924bfcd7791ecafa15ab7e (patch)
treecf364687889aa546f39b607aa57db839d7059c97 /spec/models/issue_spec.rb
parent075d6516047d899746d22b5323d3b74558e200d0 (diff)
downloadgitlab-ce-f070265a6ddd0173c8924bfcd7791ecafa15ab7e.tar.gz
Introduce new hook data builders for Issue and MergeRequest34284-add-changes-to-issuable-webhook-data
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r--spec/models/issue_spec.rb44
1 files changed, 8 insertions, 36 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index bd1ae3c4945..bb5033c1628 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -700,42 +700,14 @@ describe Issue do
end
describe '#hook_attrs' do
- let(:attrs_hash) { subject.hook_attrs }
-
- it 'includes safe attribute' do
- %w[
- assignee_id
- author_id
- branch_name
- closed_at
- confidential
- created_at
- deleted_at
- description
- due_date
- id
- iid
- last_edited_at
- last_edited_by_id
- milestone_id
- moved_to_id
- project_id
- relative_position
- state
- time_estimate
- title
- updated_at
- updated_by_id
- ].each do |key|
- expect(attrs_hash).to include(key)
- end
- end
-
- it 'includes additional attrs' do
- expect(attrs_hash).to include(:total_time_spent)
- expect(attrs_hash).to include(:human_time_estimate)
- expect(attrs_hash).to include(:human_total_time_spent)
- expect(attrs_hash).to include(:assignee_ids)
+ it 'delegates to Gitlab::HookData::IssueBuilder#build' do
+ builder = double
+
+ expect(Gitlab::HookData::IssueBuilder)
+ .to receive(:new).with(subject).and_return(builder)
+ expect(builder).to receive(:build)
+
+ subject.hook_attrs
end
end