diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-04-03 10:27:56 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-04-03 10:27:56 +0000 |
commit | dc4ae317ea858952acd5c91dd8034832638b3794 (patch) | |
tree | 4f62604b27b0ec1ed9f35a509380372e0bdcb638 /spec/features/issues | |
parent | 95b3bf26cae3c2e483df4591ec5fe492ab9746a5 (diff) | |
download | gitlab-ce-dc4ae317ea858952acd5c91dd8034832638b3794.tar.gz |
Replace the `project/issues/issues.feature` spinach test with an rspec analog
Diffstat (limited to 'spec/features/issues')
-rw-r--r-- | spec/features/issues/user_uses_slash_commands_spec.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/features/issues/user_uses_slash_commands_spec.rb b/spec/features/issues/user_uses_slash_commands_spec.rb index ea7a97d02a0..ff2a0e15719 100644 --- a/spec/features/issues/user_uses_slash_commands_spec.rb +++ b/spec/features/issues/user_uses_slash_commands_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' feature 'Issues > User uses quick actions', :js do - include QuickActionsHelpers + include Spec::Support::Helpers::Features::NotesHelpers it_behaves_like 'issuable record that supports quick actions in its description and notes', :issue do let(:issuable) { create(:issue, project: project) } @@ -36,7 +36,7 @@ feature 'Issues > User uses quick actions', :js do context 'when the current user can update the due date' do it 'does not create a note, and sets the due date accordingly' do - write_note("/due 2016-08-28") + add_note("/due 2016-08-28") expect(page).not_to have_content '/due 2016-08-28' expect(page).to have_content 'Commands applied' @@ -57,7 +57,7 @@ feature 'Issues > User uses quick actions', :js do end it 'does not create a note, and sets the due date accordingly' do - write_note("/due 2016-08-28") + add_note("/due 2016-08-28") expect(page).not_to have_content 'Commands applied' @@ -75,7 +75,7 @@ feature 'Issues > User uses quick actions', :js do it 'does not create a note, and removes the due date accordingly' do expect(issue.due_date).to eq Date.new(2016, 8, 28) - write_note("/remove_due_date") + add_note("/remove_due_date") expect(page).not_to have_content '/remove_due_date' expect(page).to have_content 'Commands applied' @@ -96,7 +96,7 @@ feature 'Issues > User uses quick actions', :js do end it 'does not create a note, and sets the due date accordingly' do - write_note("/remove_due_date") + add_note("/remove_due_date") expect(page).not_to have_content 'Commands applied' @@ -111,7 +111,7 @@ feature 'Issues > User uses quick actions', :js do let(:issue) { create(:issue, project: project) } it 'does not recognize the command nor create a note' do - write_note("/wip") + add_note("/wip") expect(page).not_to have_content '/wip' end @@ -123,7 +123,7 @@ feature 'Issues > User uses quick actions', :js do context 'when the current user can update issues' do it 'does not create a note, and marks the issue as a duplicate' do - write_note("/duplicate ##{original_issue.to_reference}") + add_note("/duplicate ##{original_issue.to_reference}") expect(page).not_to have_content "/duplicate #{original_issue.to_reference}" expect(page).to have_content 'Commands applied' @@ -143,7 +143,7 @@ feature 'Issues > User uses quick actions', :js do end it 'does not create a note, and does not mark the issue as a duplicate' do - write_note("/duplicate ##{original_issue.to_reference}") + add_note("/duplicate ##{original_issue.to_reference}") expect(page).not_to have_content 'Commands applied' expect(page).not_to have_content "marked this issue as a duplicate of #{original_issue.to_reference}" @@ -166,7 +166,7 @@ feature 'Issues > User uses quick actions', :js do end it 'moves the issue' do - write_note("/move #{target_project.full_path}") + add_note("/move #{target_project.full_path}") expect(page).to have_content 'Commands applied' expect(issue.reload).to be_closed @@ -186,7 +186,7 @@ feature 'Issues > User uses quick actions', :js do end it 'does not move the issue' do - write_note("/move #{project_unauthorized.full_path}") + add_note("/move #{project_unauthorized.full_path}") expect(page).not_to have_content 'Commands applied' expect(issue.reload).to be_open @@ -200,7 +200,7 @@ feature 'Issues > User uses quick actions', :js do end it 'does not move the issue' do - write_note("/move not/valid") + add_note("/move not/valid") expect(page).not_to have_content 'Commands applied' expect(issue.reload).to be_open @@ -223,7 +223,7 @@ feature 'Issues > User uses quick actions', :js do end it 'applies the commands to both issues and moves the issue' do - write_note("/label ~#{bug.title} ~#{wontfix.title}\n\n/milestone %\"#{milestone.title}\"\n\n/move #{target_project.full_path}") + add_note("/label ~#{bug.title} ~#{wontfix.title}\n\n/milestone %\"#{milestone.title}\"\n\n/move #{target_project.full_path}") expect(page).to have_content 'Commands applied' expect(issue.reload).to be_closed @@ -242,7 +242,7 @@ feature 'Issues > User uses quick actions', :js do end it 'moves the issue and applies the commands to both issues' do - write_note("/move #{target_project.full_path}\n\n/label ~#{bug.title} ~#{wontfix.title}\n\n/milestone %\"#{milestone.title}\"") + add_note("/move #{target_project.full_path}\n\n/label ~#{bug.title} ~#{wontfix.title}\n\n/milestone %\"#{milestone.title}\"") expect(page).to have_content 'Commands applied' expect(issue.reload).to be_closed |