diff options
author | Robert Speicher <rspeicher@gmail.com> | 2019-07-25 11:10:31 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2019-07-25 11:10:31 -0500 |
commit | 148df25638aa77d3b066788ada47d74005100c51 (patch) | |
tree | d4fad49eabdc50ef58b996e08ca4264a8a66953d | |
parent | d5c10813955651d9129b30446a1419ab124dcc61 (diff) | |
download | gitlab-ce-148df25638aa77d3b066788ada47d74005100c51.tar.gz |
Simplify resource_label_events API shared examplers-resource-label-events-api
We don't need a repository, and we only need a private user in one
example, so we can scope it locally there.
-rw-r--r-- | spec/requests/api/resource_label_events_spec.rb | 3 | ||||
-rw-r--r-- | spec/support/shared_examples/resource_label_events_api.rb | 1 |
2 files changed, 2 insertions, 2 deletions
diff --git a/spec/requests/api/resource_label_events_spec.rb b/spec/requests/api/resource_label_events_spec.rb index 6ed407d81db..25bea627b0c 100644 --- a/spec/requests/api/resource_label_events_spec.rb +++ b/spec/requests/api/resource_label_events_spec.rb @@ -4,8 +4,7 @@ require 'spec_helper' describe API::ResourceLabelEvents do set(:user) { create(:user) } - set(:project) { create(:project, :public, :repository, namespace: user.namespace) } - set(:private_user) { create(:user) } + set(:project) { create(:project, :public, namespace: user.namespace) } before do project.add_developer(user) diff --git a/spec/support/shared_examples/resource_label_events_api.rb b/spec/support/shared_examples/resource_label_events_api.rb index 6e317172823..945cb8d9f2c 100644 --- a/spec/support/shared_examples/resource_label_events_api.rb +++ b/spec/support/shared_examples/resource_label_events_api.rb @@ -19,6 +19,7 @@ shared_examples 'resource_label_events API' do |parent_type, eventable_type, id_ it "returns 404 when not authorized" do parent.update!(visibility_level: Gitlab::VisibilityLevel::PRIVATE) + private_user = create(:user) get api("/#{parent_type}/#{parent.id}/#{eventable_type}/#{eventable[id_name]}/resource_label_events", private_user) |