2018-09-07 09:39:20 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe API::ResourceLabelEvents do
|
2020-02-17 10:09:01 -05:00
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:project, reload: true) { create(:project, :public, namespace: user.namespace) }
|
|
|
|
let_it_be(:label) { create(:label, project: project) }
|
2018-09-07 09:39:20 -04:00
|
|
|
|
|
|
|
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-17 08:38:09 -04:00
|
|
|
let(:eventable) { create(:issue, project: project, author: user) }
|
2018-09-07 09:39:20 -04:00
|
|
|
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-17 08:38:09 -04:00
|
|
|
let(:eventable) { create(:merge_request, source_project: project, target_project: project, author: user) }
|
2018-09-07 09:39:20 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|