diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 15:07:45 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 15:07:45 +0000 |
commit | 1219a9dce91f4edbc135dfc08299b4122b4825a8 (patch) | |
tree | e7d12a55d75a2d56e60d9527bef3724e3578866d /spec/features | |
parent | 1a0d6dbdc2ac3047f4953a359ef27ba6e26074ae (diff) | |
download | gitlab-ce-1219a9dce91f4edbc135dfc08299b4122b4825a8.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
3 files changed, 10 insertions, 6 deletions
diff --git a/spec/features/issuables/markdown_references/jira_spec.rb b/spec/features/issuables/markdown_references/jira_spec.rb index c5818691b3c..779606effdc 100644 --- a/spec/features/issuables/markdown_references/jira_spec.rb +++ b/spec/features/issuables/markdown_references/jira_spec.rb @@ -163,7 +163,7 @@ describe "Jira", :js do markdown = <<~HEREDOC Referencing internal issue #{issue_actual_project.to_reference}, cross-project #{issue_other_project.to_reference(actual_project)} external JIRA-5 - and non existing #999 + and non existing ##{non_existing_record_iid} HEREDOC page.within("#diff-notes-app") do @@ -186,6 +186,6 @@ describe "Jira", :js do expect(page).not_to have_link("JIRA-5", href: "https://jira.example.com/browse/JIRA-5") end - expect(page).not_to have_link("#999") + expect(page).not_to have_link("##{non_existing_record_iid}") end end diff --git a/spec/features/projects/snippets/user_updates_snippet_spec.rb b/spec/features/projects/snippets/user_updates_snippet_spec.rb index bad3fde8a4a..58ca922b9cb 100644 --- a/spec/features/projects/snippets/user_updates_snippet_spec.rb +++ b/spec/features/projects/snippets/user_updates_snippet_spec.rb @@ -54,9 +54,11 @@ describe 'Projects > Snippets > User updates a snippet', :js do end context 'when the git operation fails' do + let(:error_message) { 'foobar' } + before do allow_next_instance_of(Snippets::UpdateService) do |instance| - allow(instance).to receive(:create_commit).and_raise(StandardError) + allow(instance).to receive(:create_commit).and_raise(StandardError, error_message) end fill_in('project_snippet_title', with: 'Snippet new title') @@ -65,7 +67,7 @@ describe 'Projects > Snippets > User updates a snippet', :js do end it 'renders edit page and displays the error' do - expect(page.find('.flash-container span').text).to eq('Error updating the snippet') + expect(page.find('.flash-container span').text).to eq(error_message) expect(page).to have_content('Edit Snippet') end end diff --git a/spec/features/snippets/user_edits_snippet_spec.rb b/spec/features/snippets/user_edits_snippet_spec.rb index 0bbb92b1f3f..1ec18e3e0e3 100644 --- a/spec/features/snippets/user_edits_snippet_spec.rb +++ b/spec/features/snippets/user_edits_snippet_spec.rb @@ -85,9 +85,11 @@ describe 'User edits snippet', :js do end context 'when the git operation fails' do + let(:error_message) { 'foobar' } + before do allow_next_instance_of(Snippets::UpdateService) do |instance| - allow(instance).to receive(:create_commit).and_raise(StandardError) + allow(instance).to receive(:create_commit).and_raise(StandardError, error_message) end fill_in 'personal_snippet_title', with: 'New Snippet Title' @@ -96,7 +98,7 @@ describe 'User edits snippet', :js do end it 'renders edit page and displays the error' do - expect(page.find('.flash-container span').text).to eq('Error updating the snippet') + expect(page.find('.flash-container span').text).to eq(error_message) expect(page).to have_content('Edit Snippet') end end |