2019-04-03 09:53:39 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 07:56:52 +00:00
|
|
|
require 'spec_helper'
|
2016-06-30 15:34:19 +00:00
|
|
|
|
2019-06-18 14:26:48 +00:00
|
|
|
# These are written as feature specs because they cover more specific test scenarios
|
|
|
|
# than the ones described on spec/services/notes/create_service_spec.rb for quick actions,
|
|
|
|
# for example, adding quick actions when creating the issue and checking DateTime formats on UI.
|
|
|
|
# Because this kind of spec takes more time to run there is no need to add new ones
|
|
|
|
# for each existing quick action unless they test something not tested by existing tests.
|
2022-08-23 15:09:40 +00:00
|
|
|
RSpec.describe 'Merge request > User uses quick actions', :js, :use_clean_rails_redis_caching do
|
2018-04-03 10:27:56 +00:00
|
|
|
include Spec::Support::Helpers::Features::NotesHelpers
|
2016-06-30 15:34:19 +00:00
|
|
|
|
2017-08-01 18:03:07 +00:00
|
|
|
let(:project) { create(:project, :public, :repository) }
|
|
|
|
let(:user) { project.creator }
|
|
|
|
let(:guest) { create(:user) }
|
|
|
|
let(:merge_request) { create(:merge_request, source_project: project) }
|
|
|
|
let!(:milestone) { create(:milestone, project: project, title: 'ASAP') }
|
|
|
|
|
2019-03-13 10:45:43 +00:00
|
|
|
context "issuable common quick actions" do
|
|
|
|
let!(:new_url_opts) { { merge_request: { source_branch: 'feature', target_branch: 'master' } } }
|
|
|
|
let(:maintainer) { create(:user) }
|
|
|
|
let(:project) { create(:project, :public, :repository) }
|
|
|
|
let!(:label_bug) { create(:label, project: project, title: 'bug') }
|
|
|
|
let!(:label_feature) { create(:label, project: project, title: 'feature') }
|
|
|
|
let!(:milestone) { create(:milestone, project: project, title: 'ASAP') }
|
2016-06-30 15:34:19 +00:00
|
|
|
let(:issuable) { create(:merge_request, source_project: project) }
|
2022-07-29 21:08:53 +00:00
|
|
|
let(:source_issuable) { create(:issue, project: project, milestone: milestone, labels: [label_bug, label_feature]) }
|
2019-03-13 10:45:43 +00:00
|
|
|
|
|
|
|
it_behaves_like 'close quick action', :merge_request
|
|
|
|
it_behaves_like 'issuable time tracker', :merge_request
|
2016-06-30 15:34:19 +00:00
|
|
|
end
|
|
|
|
|
2016-09-08 09:18:41 +00:00
|
|
|
describe 'merge-request-only commands' do
|
2017-08-07 05:50:33 +00:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:project) { create(:project, :public, :repository) }
|
|
|
|
let(:merge_request) { create(:merge_request, source_project: project) }
|
|
|
|
let!(:milestone) { create(:milestone, project: project, title: 'ASAP') }
|
|
|
|
|
2016-06-30 15:34:19 +00:00
|
|
|
before do
|
2018-07-11 14:36:08 +00:00
|
|
|
project.add_maintainer(user)
|
2016-06-30 15:34:19 +00:00
|
|
|
end
|
2016-10-12 16:47:31 +00:00
|
|
|
|
2019-04-03 12:00:18 +00:00
|
|
|
it_behaves_like 'merge quick action'
|
2020-12-29 12:10:19 +00:00
|
|
|
it_behaves_like 'rebase quick action'
|
2016-06-30 15:34:19 +00:00
|
|
|
end
|
|
|
|
end
|