Commit 89b0ba04 authored by Mike Greiling's avatar Mike Greiling

Merge branch...

Merge branch '273313-fy21q4-foundations-kr2-audit-and-update-buttons-on-projects-issuescontroller-new' into 'master'

Audit and update buttons on Projects::IssuesController#new

See merge request gitlab-org/gitlab!57172
parents bf208a35 75a6cbf2
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
}, },
deleteIssuableButtonText() { deleteIssuableButtonText() {
return sprintf(__('Delete %{issuableType}'), { return sprintf(__('Delete %{issuableType}'), {
issuableType: issuableTypes[this.issuableType], issuableType: issuableTypes[this.issuableType].toLowerCase(),
}); });
}, },
}, },
...@@ -79,23 +79,23 @@ export default { ...@@ -79,23 +79,23 @@ export default {
:loading="formState.updateLoading" :loading="formState.updateLoading"
:disabled="formState.updateLoading || !isSubmitEnabled" :disabled="formState.updateLoading || !isSubmitEnabled"
category="primary" category="primary"
variant="success" variant="confirm"
class="float-left qa-save-button" class="float-left qa-save-button gl-mr-3"
type="submit" type="submit"
@click.prevent="updateIssuable" @click.prevent="updateIssuable"
> >
{{ __('Save changes') }} {{ __('Save changes') }}
</gl-button> </gl-button>
<gl-button class="float-right" @click="closeForm"> <gl-button @click="closeForm">
{{ __('Cancel') }} {{ __('Cancel') }}
</gl-button> </gl-button>
<gl-button <gl-button
v-if="shouldShowDeleteButton" v-if="shouldShowDeleteButton"
:loading="deleteLoading" :loading="deleteLoading"
:disabled="deleteLoading" :disabled="deleteLoading"
category="primary" category="secondary"
variant="danger" variant="danger"
class="float-right gl-mr-3 qa-delete-button" class="float-right qa-delete-button"
@click="deleteIssuable" @click="deleteIssuable"
> >
{{ deleteIssuableButtonText }} {{ deleteIssuableButtonText }}
......
...@@ -20,4 +20,4 @@ ...@@ -20,4 +20,4 @@
- if has_submit - if has_submit
.row-content-block.footer-block .row-content-block.footer-block
= f.submit _("Submit %{humanized_resource_name}") % { humanized_resource_name: humanized_resource_name }, class: 'gl-button btn btn-confirm' = f.submit _("Create %{humanized_resource_name}") % { humanized_resource_name: humanized_resource_name }, class: 'gl-button btn btn-confirm'
...@@ -62,26 +62,24 @@ ...@@ -62,26 +62,24 @@
- is_footer = !(issuable.is_a?(MergeRequest) && issuable.new_record?) - is_footer = !(issuable.is_a?(MergeRequest) && issuable.new_record?)
.row-content-block{ class: (is_footer ? "footer-block" : "middle-block") } .row-content-block{ class: (is_footer ? "footer-block" : "middle-block") }
.float-right
- if issuable.new_record?
= link_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'gl-button btn btn-cancel'
- else
- if can?(current_user, :"destroy_#{issuable.to_ability_name}", @project)
= link_to 'Delete', polymorphic_path([@project, issuable], params: { destroy_confirm: true }), data: { confirm: "#{issuable.human_class_name} will be removed! Are you sure?" }, method: :delete, class: 'btn btn-danger btn-grouped'
= link_to _('Cancel'), polymorphic_path([@project, issuable]), class: 'gl-button btn btn-grouped btn-default btn-cancel'
%span.gl-mr-3
- if issuable.new_record?
= form.submit "Submit #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-confirm', data: { qa_selector: 'issuable_create_button' }
- else
= form.submit 'Save changes', class: 'gl-button btn btn-confirm'
- if !issuable.persisted? && !issuable.project.empty_repo? && (guide_url = issuable.project.present.contribution_guide_path) - if !issuable.persisted? && !issuable.project.empty_repo? && (guide_url = issuable.project.present.contribution_guide_path)
.inline.gl-mt-3 .gl-mb-5
Please review the Please review the
%strong= link_to('contribution guidelines', guide_url) %strong= link_to('contribution guidelines', guide_url)
for this project. for this project.
- if issuable.new_record?
= form.submit "Create #{issuable.class.model_name.human.downcase}", class: 'gl-button btn btn-confirm gl-mr-2', data: { qa_selector: 'issuable_create_button' }
- else
= form.submit 'Save changes', class: 'gl-button btn btn-confirm gl-mr-2'
- if issuable.new_record?
= link_to _('Cancel'), polymorphic_path([@project, issuable.class]), class: 'btn gl-button btn-default'
- else
= link_to _('Cancel'), polymorphic_path([@project, issuable]), class: 'gl-button btn btn-default'
- if can?(current_user, :"destroy_#{issuable.to_ability_name}", @project)
= link_to 'Delete', polymorphic_path([@project, issuable], params: { destroy_confirm: true }), data: { confirm: _('%{issuableType} will be removed! Are you sure?') % { issuableType: issuable.human_class_name } }, method: :delete, class: 'btn gl-button btn-danger btn-danger-secondary gl-float-right'
= render_if_exists 'shared/issuable/remove_approver' = render_if_exists 'shared/issuable/remove_approver'
- if issuable.respond_to?(:issue_type) - if issuable.respond_to?(:issue_type)
......
---
title: Update issuable submit content order, button variants, and button alignment
merge_request: 57172
author:
type: other
...@@ -66,27 +66,29 @@ export default { ...@@ -66,27 +66,29 @@ export default {
<div class="border-bottom"> <div class="border-bottom">
<slot name="rules"></slot> <slot name="rules"></slot>
</div> </div>
<div v-if="settings.canEdit && settings.allowMultiRule" class="border-bottom py-3 px-2"> <div v-if="settings.canEdit && settings.allowMultiRule" class="border-bottom py-3 px-3">
<div class="gl-display-flex"> <div class="gl-display-flex">
<gl-button <gl-button
v-if="targetBranch" :class="{ 'gl-mr-3': targetBranch, 'gl-mr-0': !targetBranch }"
:disabled="isLoading"
data-testid="reset-to-defaults"
@click="resetToProjectDefaults"
>
{{ __('Reset to project defaults') }}
</gl-button>
<gl-button
:class="{ 'gl-ml-3': targetBranch, 'gl-ml-0': !targetBranch }"
:disabled="isLoading" :disabled="isLoading"
category="secondary" category="secondary"
variant="info" variant="info"
size="small"
data-qa-selector="add_approvers_button" data-qa-selector="add_approvers_button"
data-testid="add-approval-rule" data-testid="add-approval-rule"
@click="openCreateModal(null)" @click="openCreateModal(null)"
> >
{{ __('Add approval rule') }} {{ __('Add approval rule') }}
</gl-button> </gl-button>
<gl-button
v-if="targetBranch"
:disabled="isLoading"
size="small"
data-testid="reset-to-defaults"
@click="resetToProjectDefaults"
>
{{ __('Reset to project defaults') }}
</gl-button>
</div> </div>
</div> </div>
<slot name="footer"></slot> <slot name="footer"></slot>
......
...@@ -32,7 +32,7 @@ RSpec.describe 'Delete Epic', :js do ...@@ -32,7 +32,7 @@ RSpec.describe 'Delete Epic', :js do
it 'deletes the issue and redirect to epic list' do it 'deletes the issue and redirect to epic list' do
page.accept_alert 'Delete this epic and all descendants?' do page.accept_alert 'Delete this epic and all descendants?' do
find(:button, text: 'Delete Epic').click find(:button, text: 'Delete epic').click
end end
wait_for_requests wait_for_requests
......
...@@ -156,7 +156,7 @@ RSpec.describe 'New/edit issue', :js do ...@@ -156,7 +156,7 @@ RSpec.describe 'New/edit issue', :js do
fill_in 'issue_weight', with: '1' fill_in 'issue_weight', with: '1'
click_button 'Submit issue' click_button 'Create issue'
page.within '.issuable-sidebar' do page.within '.issuable-sidebar' do
page.within '.assignee' do page.within '.assignee' do
......
...@@ -8,6 +8,7 @@ RSpec.describe 'Issues > User uses EE quick actions', :js do ...@@ -8,6 +8,7 @@ RSpec.describe 'Issues > User uses EE quick actions', :js do
describe 'issue-only commands' do describe 'issue-only commands' do
let_it_be(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:issue) { create(:issue, project: project) } let(:issue) { create(:issue, project: project) }
before do before do
......
...@@ -57,7 +57,7 @@ RSpec.describe "User creates a merge request", :js do ...@@ -57,7 +57,7 @@ RSpec.describe "User creates a merge request", :js do
# end # end
fill_in("Title", with: title) fill_in("Title", with: title)
click_button("Submit merge request") click_button("Create merge request")
page.within(".js-issuable-actions") do page.within(".js-issuable-actions") do
click_link("Edit", match: :first) click_link("Edit", match: :first)
......
...@@ -24,7 +24,7 @@ RSpec.describe 'User creates a merge request with blocking MRs', :js do ...@@ -24,7 +24,7 @@ RSpec.describe 'User creates a merge request with blocking MRs', :js do
visit(project_new_merge_request_path(project, merge_request: mr_params)) visit(project_new_merge_request_path(project, merge_request: mr_params))
fill_in 'Merge request dependencies', with: other_mr.to_reference(full: true) fill_in 'Merge request dependencies', with: other_mr.to_reference(full: true)
click_button('Submit merge request') click_button 'Create merge request'
expect(page).to have_content('Depends on 1 merge request') expect(page).to have_content('Depends on 1 merge request')
end end
......
...@@ -9,5 +9,5 @@ RSpec.describe 'Merge request > User creates MR with multiple assignees' do ...@@ -9,5 +9,5 @@ RSpec.describe 'Merge request > User creates MR with multiple assignees' do
stub_licensed_features(multiple_merge_request_assignees: true) stub_licensed_features(multiple_merge_request_assignees: true)
end end
it_behaves_like 'multiple assignees merge request', 'creates', 'Submit merge request' it_behaves_like 'multiple assignees merge request', 'creates', 'Create merge request'
end end
...@@ -9,5 +9,5 @@ RSpec.describe 'Merge request > User creates MR with multiple reviewers' do ...@@ -9,5 +9,5 @@ RSpec.describe 'Merge request > User creates MR with multiple reviewers' do
stub_licensed_features(multiple_merge_request_reviewers: true) stub_licensed_features(multiple_merge_request_reviewers: true)
end end
it_behaves_like 'multiple reviewers merge request', 'creates', 'Submit merge request' it_behaves_like 'multiple reviewers merge request', 'creates', 'Create merge request'
end end
...@@ -25,7 +25,7 @@ RSpec.describe 'Merge request > User selects branches for new MR', :js do ...@@ -25,7 +25,7 @@ RSpec.describe 'Merge request > User selects branches for new MR', :js do
context 'saving the MR' do context 'saving the MR' do
it 'shows the saved MR' do it 'shows the saved MR' do
fill_in 'merge_request_title', with: 'Test' fill_in 'merge_request_title', with: 'Test'
click_button 'Submit merge request' click_button 'Create merge request'
expect(page).to have_button('Close merge request') expect(page).to have_button('Close merge request')
end end
......
...@@ -66,7 +66,7 @@ RSpec.describe 'Merge request > User sets approval rules', :js do ...@@ -66,7 +66,7 @@ RSpec.describe 'Merge request > User sets approval rules', :js do
end end
it "persists hidden groups that author has no access to when creating MR" do it "persists hidden groups that author has no access to when creating MR" do
click_on("Submit merge request") click_on("Create merge request")
wait_for_requests wait_for_requests
click_on("View eligible approvers") click_on("View eligible approvers")
......
...@@ -109,7 +109,7 @@ RSpec.describe 'Merge request > User sets approvers', :js do ...@@ -109,7 +109,7 @@ RSpec.describe 'Merge request > User sets approvers', :js do
click_button 'Add approval rule' click_button 'Add approval rule'
end end
click_on("Submit merge request") click_on("Create merge request")
wait_for_all_requests wait_for_all_requests
expect(page).to have_content("Requires approval.") expect(page).to have_content("Requires approval.")
...@@ -134,7 +134,7 @@ RSpec.describe 'Merge request > User sets approvers', :js do ...@@ -134,7 +134,7 @@ RSpec.describe 'Merge request > User sets approvers', :js do
end end
click_button 'Update approval rule' click_button 'Update approval rule'
click_on("Submit merge request") click_on("Create merge request")
wait_for_all_requests wait_for_all_requests
click_on("View eligible approvers") if page.has_button?("View eligible approvers") click_on("View eligible approvers") if page.has_button?("View eligible approvers")
wait_for_requests wait_for_requests
......
...@@ -7,6 +7,7 @@ RSpec.describe "User creates issue", :js do ...@@ -7,6 +7,7 @@ RSpec.describe "User creates issue", :js do
let_it_be(:group) { create(:group, :public) } let_it_be(:group) { create(:group, :public) }
let_it_be(:project) { create(:project_empty_repo, :public, namespace: group) } let_it_be(:project) { create(:project_empty_repo, :public, namespace: group) }
let_it_be(:epic) { create(:epic, group: group, title: 'Sample epic', author: user) } let_it_be(:epic) { create(:epic, group: group, title: 'Sample epic', author: user) }
let(:issue_title) { '500 error on profile' } let(:issue_title) { '500 error on profile' }
before_all do before_all do
...@@ -29,7 +30,7 @@ RSpec.describe "User creates issue", :js do ...@@ -29,7 +30,7 @@ RSpec.describe "User creates issue", :js do
fill_in("Title", with: issue_title) fill_in("Title", with: issue_title)
fill_in("issue_weight", with: weight) fill_in("issue_weight", with: weight)
click_button("Submit issue") click_button 'Create issue'
page.within(".weight") do page.within(".weight") do
expect(page).to have_content(weight) expect(page).to have_content(weight)
...@@ -48,7 +49,7 @@ RSpec.describe "User creates issue", :js do ...@@ -48,7 +49,7 @@ RSpec.describe "User creates issue", :js do
it 'creates an issue with no epic' do it 'creates an issue with no epic' do
click_button 'Select epic' click_button 'Select epic'
find('.gl-new-dropdown-item', text: 'No Epic').click find('.gl-new-dropdown-item', text: 'No Epic').click
click_button('Submit issue') click_button 'Create issue'
wait_for_all_requests wait_for_all_requests
...@@ -62,7 +63,7 @@ RSpec.describe "User creates issue", :js do ...@@ -62,7 +63,7 @@ RSpec.describe "User creates issue", :js do
it 'credates an issue with an epic' do it 'credates an issue with an epic' do
click_button 'Select epic' click_button 'Select epic'
find('.gl-new-dropdown-item', text: epic.title).click find('.gl-new-dropdown-item', text: epic.title).click
click_button('Submit issue') click_button 'Create issue'
wait_for_all_requests wait_for_all_requests
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
RSpec.shared_examples 'status page quick actions' do RSpec.shared_examples 'status page quick actions' do
describe '/publish' do describe '/publish' do
let_it_be(:status_page_setting) { create(:status_page_setting, :enabled, project: project) } let_it_be(:status_page_setting) { create(:status_page_setting, :enabled, project: project) }
let(:user) { project.owner } let(:user) { project.owner }
before do before do
...@@ -35,7 +36,7 @@ RSpec.shared_examples 'status page quick actions' do ...@@ -35,7 +36,7 @@ RSpec.shared_examples 'status page quick actions' do
fill_in('Title', with: 'Title') fill_in('Title', with: 'Title')
fill_in('Description', with: "Published issue \n\n/publish") fill_in('Description', with: "Published issue \n\n/publish")
click_button('Submit issue') click_button('Create issue')
wait_for_requests wait_for_requests
......
...@@ -8774,6 +8774,9 @@ msgstr "" ...@@ -8774,6 +8774,9 @@ msgstr ""
msgid "Create %{environment}" msgid "Create %{environment}"
msgstr "" msgstr ""
msgid "Create %{humanized_resource_name}"
msgstr ""
msgid "Create %{type}" msgid "Create %{type}"
msgstr "" msgstr ""
...@@ -29289,9 +29292,6 @@ msgstr "" ...@@ -29289,9 +29292,6 @@ msgstr ""
msgid "Submit" msgid "Submit"
msgstr "" msgstr ""
msgid "Submit %{humanized_resource_name}"
msgstr ""
msgid "Submit a review" msgid "Submit a review"
msgstr "" msgstr ""
......
...@@ -27,7 +27,7 @@ RSpec.describe 'Ensure Boards do not show stale data on browser back', :js do ...@@ -27,7 +27,7 @@ RSpec.describe 'Ensure Boards do not show stale data on browser back', :js do
fill_in 'issue_title', with: 'issue should be shown' fill_in 'issue_title', with: 'issue should be shown'
click_button 'Submit issue' click_button 'Create issue'
page.go_back page.go_back
wait_for_requests wait_for_requests
......
...@@ -156,7 +156,7 @@ RSpec.describe 'New/edit issue', :js do ...@@ -156,7 +156,7 @@ RSpec.describe 'New/edit issue', :js do
expect(page.all('input[name="issue[label_ids][]"]', visible: false)[1].value).to match(label.id.to_s) expect(page.all('input[name="issue[label_ids][]"]', visible: false)[1].value).to match(label.id.to_s)
expect(page.all('input[name="issue[label_ids][]"]', visible: false)[2].value).to match(label2.id.to_s) expect(page.all('input[name="issue[label_ids][]"]', visible: false)[2].value).to match(label2.id.to_s)
click_button 'Submit issue' click_button 'Create issue'
page.within '.issuable-sidebar' do page.within '.issuable-sidebar' do
page.within '.assignee' do page.within '.assignee' do
......
...@@ -43,7 +43,7 @@ RSpec.describe 'New issue', :js do ...@@ -43,7 +43,7 @@ RSpec.describe 'New issue', :js do
end end
it 'rejects issue creation' do it 'rejects issue creation' do
click_button 'Submit issue' click_button 'Create issue'
expect(page).to have_content('discarded') expect(page).to have_content('discarded')
expect(page).not_to have_content('potential spam') expect(page).not_to have_content('potential spam')
...@@ -51,7 +51,7 @@ RSpec.describe 'New issue', :js do ...@@ -51,7 +51,7 @@ RSpec.describe 'New issue', :js do
end end
it 'creates a spam log record' do it 'creates a spam log record' do
expect { click_button 'Submit issue' } expect { click_button 'Create issue' }
.to log_spam(title: 'issue title', description: 'issue description', user_id: user.id, noteable_type: 'Issue') .to log_spam(title: 'issue title', description: 'issue description', user_id: user.id, noteable_type: 'Issue')
end end
end end
...@@ -63,14 +63,14 @@ RSpec.describe 'New issue', :js do ...@@ -63,14 +63,14 @@ RSpec.describe 'New issue', :js do
end end
it 'allows issue creation' do it 'allows issue creation' do
click_button 'Submit issue' click_button 'Create issue'
expect(page.find('.issue-details h2.title')).to have_content('issue title') expect(page.find('.issue-details h2.title')).to have_content('issue title')
expect(page.find('.issue-details .description')).to have_content('issue description') expect(page.find('.issue-details .description')).to have_content('issue description')
end end
it 'creates a spam log record' do it 'creates a spam log record' do
expect { click_button 'Submit issue' } expect { click_button 'Create issue' }
.to log_spam(title: 'issue title', description: 'issue description', user_id: user.id, noteable_type: 'Issue') .to log_spam(title: 'issue title', description: 'issue description', user_id: user.id, noteable_type: 'Issue')
end end
end end
...@@ -101,14 +101,14 @@ RSpec.describe 'New issue', :js do ...@@ -101,14 +101,14 @@ RSpec.describe 'New issue', :js do
fill_in 'issue_title', with: 'issue title' fill_in 'issue_title', with: 'issue title'
fill_in 'issue_description', with: 'issue description' fill_in 'issue_description', with: 'issue description'
click_button 'Submit issue' click_button 'Create issue'
# it is impossible to test reCAPTCHA automatically and there is no possibility to fill in recaptcha # it is impossible to test reCAPTCHA automatically and there is no possibility to fill in recaptcha
# reCAPTCHA verification is skipped in test environment and it always returns true # reCAPTCHA verification is skipped in test environment and it always returns true
expect(page).not_to have_content('issue title') expect(page).not_to have_content('issue title')
expect(page).to have_css('.recaptcha') expect(page).to have_css('.recaptcha')
click_button 'Submit issue' click_button 'Create issue'
expect(page.find('.issue-details h2.title')).to have_content('issue title') expect(page.find('.issue-details h2.title')).to have_content('issue title')
expect(page.find('.issue-details .description')).to have_content('issue description') expect(page.find('.issue-details .description')).to have_content('issue description')
...@@ -122,7 +122,7 @@ RSpec.describe 'New issue', :js do ...@@ -122,7 +122,7 @@ RSpec.describe 'New issue', :js do
end end
it 'creates an issue without a need to solve reCAPTCHA' do it 'creates an issue without a need to solve reCAPTCHA' do
click_button 'Submit issue' click_button 'Create issue'
expect(page).not_to have_css('.recaptcha') expect(page).not_to have_css('.recaptcha')
expect(page.find('.issue-details h2.title')).to have_content('issue title') expect(page.find('.issue-details h2.title')).to have_content('issue title')
...@@ -130,7 +130,7 @@ RSpec.describe 'New issue', :js do ...@@ -130,7 +130,7 @@ RSpec.describe 'New issue', :js do
end end
it 'creates a spam log record' do it 'creates a spam log record' do
expect { click_button 'Submit issue' } expect { click_button 'Create issue' }
.to log_spam(title: 'issue title', description: 'issue description', user_id: user.id, noteable_type: 'Issue') .to log_spam(title: 'issue title', description: 'issue description', user_id: user.id, noteable_type: 'Issue')
end end
end end
...@@ -148,7 +148,7 @@ RSpec.describe 'New issue', :js do ...@@ -148,7 +148,7 @@ RSpec.describe 'New issue', :js do
end end
it 'creates an issue without a need to solve reCaptcha' do it 'creates an issue without a need to solve reCaptcha' do
click_button 'Submit issue' click_button 'Create issue'
expect(page).not_to have_css('.recaptcha') expect(page).not_to have_css('.recaptcha')
expect(page.find('.issue-details h2.title')).to have_content('issue title') expect(page.find('.issue-details h2.title')).to have_content('issue title')
...@@ -156,7 +156,7 @@ RSpec.describe 'New issue', :js do ...@@ -156,7 +156,7 @@ RSpec.describe 'New issue', :js do
end end
it 'creates a spam log record' do it 'creates a spam log record' do
expect { click_button 'Submit issue' } expect { click_button 'Create issue' }
.to log_spam(title: 'issue title', description: 'issue description', user_id: user.id, noteable_type: 'Issue') .to log_spam(title: 'issue title', description: 'issue description', user_id: user.id, noteable_type: 'Issue')
end end
end end
...@@ -178,7 +178,7 @@ RSpec.describe 'New issue', :js do ...@@ -178,7 +178,7 @@ RSpec.describe 'New issue', :js do
fill_in 'issue_title', with: 'issue title' fill_in 'issue_title', with: 'issue title'
fill_in 'issue_description', with: 'issue description' fill_in 'issue_description', with: 'issue description'
click_button 'Submit issue' click_button 'Create issue'
expect(page.find('.issue-details h2.title')).to have_content('issue title') expect(page.find('.issue-details h2.title')).to have_content('issue title')
expect(page.find('.issue-details .description')).to have_content('issue description') expect(page.find('.issue-details .description')).to have_content('issue description')
......
...@@ -54,7 +54,7 @@ RSpec.describe "User creates issue" do ...@@ -54,7 +54,7 @@ RSpec.describe "User creates issue" do
first('.js-md').click first('.js-md').click
first('.rspec-issuable-form-description').native.send_keys('Description') first('.rspec-issuable-form-description').native.send_keys('Description')
click_button("Submit issue") click_button("Create issue")
expect(page).to have_content(issue_title) expect(page).to have_content(issue_title)
.and have_content(user.name) .and have_content(user.name)
...@@ -112,7 +112,7 @@ RSpec.describe "User creates issue" do ...@@ -112,7 +112,7 @@ RSpec.describe "User creates issue" do
fill_in("Title", with: issue_title) fill_in("Title", with: issue_title)
click_button("Label") click_button("Label")
click_link(label_titles.first) click_link(label_titles.first)
click_button("Submit issue") click_button("Create issue")
expect(page).to have_content(issue_title) expect(page).to have_content(issue_title)
.and have_content(user.name) .and have_content(user.name)
...@@ -135,7 +135,7 @@ RSpec.describe "User creates issue" do ...@@ -135,7 +135,7 @@ RSpec.describe "User creates issue" do
expect(find('#issuable-due-date').value).to eq date.to_s expect(find('#issuable-due-date').value).to eq date.to_s
click_button 'Submit issue' click_button 'Create issue'
page.within '.issuable-sidebar' do page.within '.issuable-sidebar' do
expect(page).to have_content date.to_s(:medium) expect(page).to have_content date.to_s(:medium)
...@@ -259,7 +259,7 @@ RSpec.describe "User creates issue" do ...@@ -259,7 +259,7 @@ RSpec.describe "User creates issue" do
fill_in 'issue_title', with: 'bug 345' fill_in 'issue_title', with: 'bug 345'
fill_in 'issue_description', with: 'bug description' fill_in 'issue_description', with: 'bug description'
click_button 'Submit issue' click_button 'Create issue'
end end
end end
end end
......
...@@ -28,7 +28,7 @@ RSpec.describe 'create a merge request, allowing commits from members who can me ...@@ -28,7 +28,7 @@ RSpec.describe 'create a merge request, allowing commits from members who can me
check 'Allow commits from members who can merge to the target branch' check 'Allow commits from members who can merge to the target branch'
click_button 'Submit merge request' click_button 'Create merge request'
wait_for_requests wait_for_requests
......
...@@ -31,7 +31,7 @@ RSpec.describe "User creates a merge request", :js do ...@@ -31,7 +31,7 @@ RSpec.describe "User creates a merge request", :js do
end end
fill_in("Title", with: title) fill_in("Title", with: title)
click_button("Submit merge request") click_button("Create merge request")
page.within(".merge-request") do page.within(".merge-request") do
expect(page).to have_content(title) expect(page).to have_content(title)
...@@ -103,7 +103,7 @@ RSpec.describe "User creates a merge request", :js do ...@@ -103,7 +103,7 @@ RSpec.describe "User creates a merge request", :js do
end end
find('.js-assignee-search').click find('.js-assignee-search').click
click_button("Submit merge request") click_button("Create merge request")
expect(page).to have_content(title).and have_content("Request to merge #{user.namespace.path}:#{source_branch} into master") expect(page).to have_content(title).and have_content("Request to merge #{user.namespace.path}:#{source_branch} into master")
end end
......
...@@ -32,7 +32,7 @@ RSpec.describe 'Merge request > User sees merge widget', :js do ...@@ -32,7 +32,7 @@ RSpec.describe 'Merge request > User sees merge widget', :js do
end end
it 'shows widget status after creating new merge request' do it 'shows widget status after creating new merge request' do
click_button 'Submit merge request' click_button 'Create merge request'
wait_for_requests wait_for_requests
......
...@@ -60,7 +60,7 @@ RSpec.describe 'Merge request > User selects branches for new MR', :js do ...@@ -60,7 +60,7 @@ RSpec.describe 'Merge request > User selects branches for new MR', :js do
expect(page).to have_content "wm.png" expect(page).to have_content "wm.png"
fill_in "merge_request_title", with: "Orphaned MR test" fill_in "merge_request_title", with: "Orphaned MR test"
click_button "Submit merge request" click_button "Create merge request"
click_button "Check out branch" click_button "Check out branch"
...@@ -200,7 +200,7 @@ RSpec.describe 'Merge request > User selects branches for new MR', :js do ...@@ -200,7 +200,7 @@ RSpec.describe 'Merge request > User selects branches for new MR', :js do
click_button "Compare branches" click_button "Compare branches"
expect(page).to have_button("Submit merge request") expect(page).to have_button("Create merge request")
end end
end end
end end
...@@ -92,7 +92,7 @@ RSpec.describe 'User squashes a merge request', :js do ...@@ -92,7 +92,7 @@ RSpec.describe 'User squashes a merge request', :js do
before do before do
visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: source_branch }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: source_branch })
check 'merge_request[squash]' check 'merge_request[squash]'
click_on 'Submit merge request' click_on 'Create merge request'
wait_for_requests wait_for_requests
end end
...@@ -121,7 +121,7 @@ RSpec.describe 'User squashes a merge request', :js do ...@@ -121,7 +121,7 @@ RSpec.describe 'User squashes a merge request', :js do
context 'when squash is not enabled on merge request creation', :sidekiq_might_not_need_inline do context 'when squash is not enabled on merge request creation', :sidekiq_might_not_need_inline do
before do before do
visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: source_branch }) visit project_new_merge_request_path(project, merge_request: { target_branch: 'master', source_branch: source_branch })
click_on 'Submit merge request' click_on 'Create merge request'
wait_for_requests wait_for_requests
end end
......
...@@ -48,7 +48,7 @@ describe('Edit Actions components', () => { ...@@ -48,7 +48,7 @@ describe('Edit Actions components', () => {
vm.formState.title = ''; vm.formState.title = '';
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.querySelector('.btn-success').getAttribute('disabled')).toBe('disabled'); expect(vm.$el.querySelector('.btn-confirm').getAttribute('disabled')).toBe('disabled');
done(); done();
}); });
...@@ -65,16 +65,16 @@ describe('Edit Actions components', () => { ...@@ -65,16 +65,16 @@ describe('Edit Actions components', () => {
describe('updateIssuable', () => { describe('updateIssuable', () => {
it('sends update.issauble event when clicking save button', () => { it('sends update.issauble event when clicking save button', () => {
vm.$el.querySelector('.btn-success').click(); vm.$el.querySelector('.btn-confirm').click();
expect(eventHub.$emit).toHaveBeenCalledWith('update.issuable'); expect(eventHub.$emit).toHaveBeenCalledWith('update.issuable');
}); });
it('disabled button after clicking save button', (done) => { it('disabled button after clicking save button', (done) => {
vm.$el.querySelector('.btn-success').click(); vm.$el.querySelector('.btn-confirm').click();
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.querySelector('.btn-success').getAttribute('disabled')).toBe('disabled'); expect(vm.$el.querySelector('.btn-confirm').getAttribute('disabled')).toBe('disabled');
done(); done();
}); });
......
...@@ -43,7 +43,7 @@ RSpec.shared_examples 'a creatable merge request' do ...@@ -43,7 +43,7 @@ RSpec.shared_examples 'a creatable merge request' do
expect(page.all('input[name="merge_request[label_ids][]"]', visible: false)[1].value).to match(label.id.to_s) expect(page.all('input[name="merge_request[label_ids][]"]', visible: false)[1].value).to match(label.id.to_s)
expect(page.all('input[name="merge_request[label_ids][]"]', visible: false)[2].value).to match(label2.id.to_s) expect(page.all('input[name="merge_request[label_ids][]"]', visible: false)[2].value).to match(label2.id.to_s)
click_button 'Submit merge request' click_button 'Create merge request'
page.within '.issuable-sidebar' do page.within '.issuable-sidebar' do
page.within '.assignee' do page.within '.assignee' do
......
...@@ -14,11 +14,11 @@ RSpec.shared_examples 'creating an issue for a thread' do ...@@ -14,11 +14,11 @@ RSpec.shared_examples 'creating an issue for a thread' do
end end
it 'can create a new issue for the project' do it 'can create a new issue for the project' do
expect { click_button 'Submit issue' }.to change { project.issues.reload.size }.by(1) expect { click_button 'Create issue' }.to change { project.issues.reload.size }.by(1)
end end
it 'resolves the discussion in the merge request' do it 'resolves the discussion in the merge request' do
click_button 'Submit issue' click_button 'Create issue'
discussion.first_note.reload discussion.first_note.reload
...@@ -26,7 +26,7 @@ RSpec.shared_examples 'creating an issue for a thread' do ...@@ -26,7 +26,7 @@ RSpec.shared_examples 'creating an issue for a thread' do
end end
it 'shows a flash messaage after resolving a discussion' do it 'shows a flash messaage after resolving a discussion' do
click_button 'Submit issue' click_button 'Create issue'
page.within '.flash-notice' do page.within '.flash-notice' do
# Only check for the word 'Resolved' since the spec might have resolved # Only check for the word 'Resolved' since the spec might have resolved
......
...@@ -23,7 +23,7 @@ RSpec.shared_examples 'close quick action' do |issuable_type| ...@@ -23,7 +23,7 @@ RSpec.shared_examples 'close quick action' do |issuable_type|
it "creates the #{issuable_type} and interprets close quick action accordingly" do it "creates the #{issuable_type} and interprets close quick action accordingly" do
fill_in "#{issuable_type}_title", with: 'bug 345' fill_in "#{issuable_type}_title", with: 'bug 345'
fill_in "#{issuable_type}_description", with: "bug description\n/close" fill_in "#{issuable_type}_description", with: "bug description\n/close"
click_button "Submit #{issuable_type}".humanize click_button "Create #{issuable_type}".humanize
issuable = project.public_send(issuable_type.to_s.pluralize).first issuable = project.public_send(issuable_type.to_s.pluralize).first
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment