2018-11-20 20:47:30 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe API::ResourceLabelEvents do
|
|
|
|
set(:user) { create(:user) }
|
2019-09-30 23:59:55 +05:30
|
|
|
set(:project) { create(:project, :public, namespace: user.namespace) }
|
|
|
|
set(:label) { create(:label, project: project) }
|
2018-11-20 20:47:30 +05:30
|
|
|
|
|
|
|
before do
|
|
|
|
project.add_developer(user)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when eventable is an Issue' do
|
|
|
|
it_behaves_like 'resource_label_events API', 'projects', 'issues', 'iid' do
|
|
|
|
let(:parent) { project }
|
2019-09-30 23:59:55 +05:30
|
|
|
let(:eventable) { create(:issue, project: project, author: user) }
|
2018-11-20 20:47:30 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when eventable is a Merge Request' do
|
|
|
|
it_behaves_like 'resource_label_events API', 'projects', 'merge_requests', 'iid' do
|
|
|
|
let(:parent) { project }
|
2019-09-30 23:59:55 +05:30
|
|
|
let(:eventable) { create(:merge_request, source_project: project, target_project: project, author: user) }
|
2018-11-20 20:47:30 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|