summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples
diff options
context:
space:
mode:
authorMarkus Koller <markus-koller@gmx.ch>2017-09-18 15:03:24 +0200
committerMarkus Koller <markus.koller.ext@siemens.com>2017-11-06 10:51:46 +0100
commit6902848a9c54f9eb1bfd82fe173ad0d5d62fe2d5 (patch)
tree9a28f3a4e52c7e6108a7f0358f813a375eec90a2 /spec/support/shared_examples
parent823a9d351b49a6be8c12cfe06edb4aa6ec08fe95 (diff)
downloadgitlab-ce-6902848a9c54f9eb1bfd82fe173ad0d5d62fe2d5.tar.gz
Support custom attributes on projects
Diffstat (limited to 'spec/support/shared_examples')
-rw-r--r--spec/support/shared_examples/requests/api/custom_attributes_shared_examples.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/support/shared_examples/requests/api/custom_attributes_shared_examples.rb b/spec/support/shared_examples/requests/api/custom_attributes_shared_examples.rb
index 6bc39f2f279..4e18804b937 100644
--- a/spec/support/shared_examples/requests/api/custom_attributes_shared_examples.rb
+++ b/spec/support/shared_examples/requests/api/custom_attributes_shared_examples.rb
@@ -3,7 +3,9 @@ shared_examples 'custom attributes endpoints' do |attributable_name|
let!(:custom_attribute2) { attributable.custom_attributes.create key: 'bar', value: 'bar' }
describe "GET /#{attributable_name} with custom attributes filter" do
- let!(:other_attributable) { create attributable.class.name.underscore }
+ before do
+ other_attributable
+ end
context 'with an unauthorized user' do
it 'does not filter by custom attributes' do
@@ -11,6 +13,7 @@ shared_examples 'custom attributes endpoints' do |attributable_name|
expect(response).to have_gitlab_http_status(200)
expect(json_response.size).to be 2
+ expect(json_response.map { |r| r['id'] }).to contain_exactly attributable.id, other_attributable.id
end
end