2019-04-15 12:14:22 +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.
|
2020-06-16 18:09:01 +00:00
|
|
|
RSpec.describe 'Issues > User uses quick actions', :js do
|
2018-04-03 10:27:56 +00:00
|
|
|
include Spec::Support::Helpers::Features::NotesHelpers
|
2016-06-30 15:34:19 +00:00
|
|
|
|
2019-03-13 10:45:43 +00: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 15:34:19 +00:00
|
|
|
let(:issuable) { create(:issue, project: project) }
|
2019-03-13 10:45:43 +00: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 15:34:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe 'issue-only commands' do
|
|
|
|
let(:user) { create(:user) }
|
2019-04-03 10:49:43 +00:00
|
|
|
let(:project) { create(:project, :public, :repository) }
|
2019-04-03 11:41:49 +00:00
|
|
|
let(:issue) { create(:issue, project: project, due_date: Date.new(2016, 8, 28)) }
|
2016-06-30 15:34:19 +00:00
|
|
|
|
|
|
|
before do
|
2018-07-11 14:36:08 +00:00
|
|
|
project.add_maintainer(user)
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in(user)
|
2017-07-06 16:20:50 +00:00
|
|
|
visit project_issue_path(project, issue)
|
2019-03-13 10:45:43 +00:00
|
|
|
wait_for_all_requests
|
2016-06-30 15:34:19 +00:00
|
|
|
end
|
|
|
|
|
2016-09-08 22:51:35 +00:00
|
|
|
after do
|
2017-05-17 18:25:13 +00:00
|
|
|
wait_for_requests
|
2016-09-08 22:51:35 +00:00
|
|
|
end
|
|
|
|
|
2019-04-03 10:49:43 +00:00
|
|
|
it_behaves_like 'create_merge_request quick action'
|
2019-04-03 09:53:39 +00:00
|
|
|
it_behaves_like 'move quick action'
|
2019-09-14 00:06:25 +00:00
|
|
|
it_behaves_like 'zoom quick actions'
|
2020-12-03 21:09:35 +00:00
|
|
|
it_behaves_like 'clone quick action'
|
2016-06-30 15:34:19 +00:00
|
|
|
end
|
|
|
|
end
|