diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2019-06-24 12:51:34 +0300 |
---|---|---|
committer | Jan Provaznik <jprovaznik@gitlab.com> | 2019-06-24 12:51:34 +0300 |
commit | 4189ffe2142e0a0969a3f28ec55e069c3b5abb9f (patch) | |
tree | abb30e42e8317a53dfe72c5cfaa7ddfd28ce47ae /spec/models/issue_spec.rb | |
parent | da4702493d046e6de24c0a071b0162818e9d990c (diff) |
Added labels_hook_attrs method
Based on review comment fetching labels hook_attrs is now
wrapped in an issue's model method.
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r-- | spec/models/issue_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index a5c7e9db2a1..d5b016dc8f6 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -862,4 +862,13 @@ describe Issue do end end end + + describe "#labels_hook_attrs" do + let(:label) { create(:label) } + let(:issue) { create(:labeled_issue, labels: [label]) } + + it "returns a list of label hook attributes" do + expect(issue.labels_hook_attrs).to eq([label.hook_attrs]) + end + end end |