148df25638
We don't need a repository, and we only need a private user in one example, so we can scope it locally there.
32 lines
1,007 B
Ruby
32 lines
1,007 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
describe API::ResourceLabelEvents do
|
|
set(:user) { create(:user) }
|
|
set(:project) { create(:project, :public, namespace: user.namespace) }
|
|
|
|
before do
|
|
project.add_developer(user)
|
|
end
|
|
|
|
context 'when eventable is an Issue' do
|
|
let(:issue) { create(:issue, project: project, author: user) }
|
|
|
|
it_behaves_like 'resource_label_events API', 'projects', 'issues', 'iid' do
|
|
let(:parent) { project }
|
|
let(:eventable) { issue }
|
|
let!(:event) { create(:resource_label_event, issue: issue) }
|
|
end
|
|
end
|
|
|
|
context 'when eventable is a Merge Request' do
|
|
let(:merge_request) { create(:merge_request, source_project: project, target_project: project, author: user) }
|
|
|
|
it_behaves_like 'resource_label_events API', 'projects', 'merge_requests', 'iid' do
|
|
let(:parent) { project }
|
|
let(:eventable) { merge_request }
|
|
let!(:event) { create(:resource_label_event, merge_request: merge_request) }
|
|
end
|
|
end
|
|
end
|