2018-11-20 20:47:30 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
RSpec.describe API::ResourceLabelEvents, feature_category: :team_planning do
|
2020-03-09 13:42:32 +05:30
|
|
|
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-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
|