Commit 7048dd8b authored by Erick Banks's avatar Erick Banks

Use let syntax

parent 4c942812
...@@ -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