Commit 08d17c57 authored by Robert Speicher's avatar Robert Speicher

Simplify resource_label_events API shared example

We don't need a repository, and we only need a private user in one
example, so we can scope it locally there.
parent 9538982d
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment