2019-07-31 22:56:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-13 17:45:13 +05:30
|
|
|
require 'rails_helper'
|
|
|
|
|
2019-09-30 21:07:59 +05:30
|
|
|
# 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.
|
2018-11-08 19:23:39 +05:30
|
|
|
describe 'Issues > User uses quick actions', :js do
|
2018-05-09 12:01:36 +05:30
|
|
|
include Spec::Support::Helpers::Features::NotesHelpers
|
2016-09-13 17:45:13 +05:30
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
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-09-13 17:45:13 +05:30
|
|
|
let(:issuable) { create(:issue, project: project) }
|
2019-07-07 11:18:12 +05:30
|
|
|
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-09-13 17:45:13 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
describe 'issue-only commands' do
|
|
|
|
let(:user) { create(:user) }
|
2019-07-31 22:56:46 +05:30
|
|
|
let(:project) { create(:project, :public, :repository) }
|
2019-07-07 11:18:12 +05:30
|
|
|
let(:issue) { create(:issue, project: project, due_date: Date.new(2016, 8, 28)) }
|
2016-09-13 17:45:13 +05:30
|
|
|
|
|
|
|
before do
|
2018-11-18 11:00:15 +05:30
|
|
|
project.add_maintainer(user)
|
2017-09-10 17:25:29 +05:30
|
|
|
sign_in(user)
|
|
|
|
visit project_issue_path(project, issue)
|
2019-07-07 11:18:12 +05:30
|
|
|
wait_for_all_requests
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|
|
|
|
|
2016-09-29 09:46:39 +05:30
|
|
|
after do
|
2017-09-10 17:25:29 +05:30
|
|
|
wait_for_requests
|
|
|
|
end
|
|
|
|
|
2019-07-31 22:56:46 +05:30
|
|
|
it_behaves_like 'create_merge_request quick action'
|
|
|
|
it_behaves_like 'move quick action'
|
2016-09-13 17:45:13 +05:30
|
|
|
end
|
|
|
|
end
|