Commit 9cda1414 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'egb-refactor-view_merge_request_diff_patch_spec' into 'master'

Use let syntax for qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb

See merge request gitlab-org/gitlab!37263
parents f9161227 7048dd8b
...@@ -3,31 +3,30 @@ ...@@ -3,31 +3,30 @@
module QA module QA
RSpec.describe 'Create' do RSpec.describe 'Create' do
describe 'Download merge request patch and diff' do describe 'Download merge request patch and diff' do
before(:context) do let(:merge_request) do
@merge_request = Resource::MergeRequest.fabricate_via_api! do |merge_request| Resource::MergeRequest.fabricate_via_api! do |merge_request|
merge_request.title = 'This is a merge request' merge_request.title = 'This is a merge request'
merge_request.description = '... for downloading patches and diffs' merge_request.description = '... for downloading patches and diffs'
end end
end end
it 'views the merge request email patches' do before do
Flow::Login.sign_in Flow::Login.sign_in
merge_request.visit!
end
@merge_request.visit! it 'views the merge request email patches' do
Page::MergeRequest::Show.perform(&:view_email_patches) Page::MergeRequest::Show.perform(&:view_email_patches)
expect(page.text).to start_with('From') expect(page.text).to start_with('From')
expect(page).to have_content('Subject: [PATCH] This is a test commit') expect(page).to have_content('Subject: [PATCH] This is a test commit')
expect(page).to have_content("diff --git a/#{@merge_request.file_name} b/#{@merge_request.file_name}") expect(page).to have_content("diff --git a/#{merge_request.file_name} b/#{merge_request.file_name}")
end end
it 'views the merge request plain diff' do it 'views the merge request plain diff' do
Flow::Login.sign_in
@merge_request.visit!
Page::MergeRequest::Show.perform(&:view_plain_diff) Page::MergeRequest::Show.perform(&:view_plain_diff)
expect(page.text).to start_with("diff --git a/#{@merge_request.file_name} b/#{@merge_request.file_name}") expect(page.text).to start_with("diff --git a/#{merge_request.file_name} b/#{merge_request.file_name}")
expect(page).to have_content('+File Added') expect(page).to have_content('+File Added')
end end
end end
......
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