2019-04-15 08:14:22 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2016-06-30 11:34:19 -04:00
|
|
|
|
2019-06-18 10:26:48 -04: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.
|
2020-06-16 14:09:01 -04:00
|
|
|
RSpec.describe 'Issues > User uses quick actions', :js do
|
2018-04-03 06:27:56 -04:00
|
|
|
include Spec::Support::Helpers::Features::NotesHelpers
|
2016-06-30 11:34:19 -04:00
|
|
|
|
2019-03-13 06:45:43 -04:00
|
|
|
context "issuable common quick actions" do
|
|
|
|
let(:new_url_opts) { {} }
|
|
|
|
let(:maintainer) { create(:user) }
|
|
|
|
let(:project) { create(:project, :public) }
|
|
|
|
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 11:34:19 -04:00
|
|
|
let(:issuable) { create(:issue, project: project) }
|
2019-03-13 06:45:43 -04:00
|
|
|
let(:source_issuable) { create(:issue, project: project, milestone: milestone, labels: [label_bug, label_feature])}
|
|
|
|
|
|
|
|
it_behaves_like 'close quick action', :issue
|
|
|
|
it_behaves_like 'issuable time tracker', :issue
|
2016-06-30 11:34:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'issue-only commands' do
|
|
|
|
let(:user) { create(:user) }
|
2019-04-03 06:49:43 -04:00
|
|
|
let(:project) { create(:project, :public, :repository) }
|
2019-04-03 07:41:49 -04:00
|
|
|
let(:issue) { create(:issue, project: project, due_date: Date.new(2016, 8, 28)) }
|
2016-06-30 11:34:19 -04:00
|
|
|
|
|
|
|
before do
|
2018-07-11 10:36:08 -04:00
|
|
|
project.add_maintainer(user)
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(user)
|
2017-07-06 12:20:50 -04:00
|
|
|
visit project_issue_path(project, issue)
|
2019-03-13 06:45:43 -04:00
|
|
|
wait_for_all_requests
|
2016-06-30 11:34:19 -04:00
|
|
|
end
|
|
|
|
|
2016-09-08 18:51:35 -04:00
|
|
|
after do
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-09-08 18:51:35 -04:00
|
|
|
end
|
|
|
|
|
2019-04-03 06:49:43 -04:00
|
|
|
it_behaves_like 'create_merge_request quick action'
|
2019-04-03 05:53:39 -04:00
|
|
|
it_behaves_like 'move quick action'
|
2019-09-13 20:06:25 -04:00
|
|
|
it_behaves_like 'zoom quick actions'
|
2020-12-03 16:09:35 -05:00
|
|
|
it_behaves_like 'clone quick action'
|
2021-11-15 13:12:21 -05:00
|
|
|
it_behaves_like 'promote_to_incident quick action'
|
2016-06-30 11:34:19 -04:00
|
|
|
end
|
|
|
|
end
|