diff options
author | Linda Dai <3424400-lindai@users.noreply.gitlab.com> | 2019-03-05 22:47:01 +0000 |
---|---|---|
committer | Mark Lapierre <mlapierre@gitlab.com> | 2019-03-05 22:47:01 +0000 |
commit | a0c6d085d7838d36f0e65d33841c0ad32b8ce4e2 (patch) | |
tree | 4a8ea3b278c5ebbffa15cc6db7751cdb005317b0 /qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb | |
parent | d11b112664db578327d028cb4552f408e89222d0 (diff) | |
download | gitlab-ce-a0c6d085d7838d36f0e65d33841c0ad32b8ce4e2.tar.gz |
Add QA test to download merge request patch/diffs
Diffstat (limited to 'qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb')
-rw-r--r-- | qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb new file mode 100644 index 00000000000..9e48ee7ca2a --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/view_merge_request_diff_patch_spec.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module QA + context 'Create' do + describe 'Download merge request patch and diff' do + before(:context) do + Runtime::Browser.visit(:gitlab, Page::Main::Login) + Page::Main::Login.perform(&:sign_in_using_credentials) + + @merge_request = Resource::MergeRequest.fabricate! do |merge_request| + merge_request.title = 'This is a merge request' + merge_request.description = 'For downloading patches and diffs' + end + end + + it 'user views merge request email patches' do + @merge_request.visit! + Page::MergeRequest::Show.perform(&:view_email_patches) + + expect(page.text).to start_with('From') + expect(page).to have_content('Subject: [PATCH] This is a test commit') + expect(page).to have_content('diff --git a/added_file.txt b/added_file.txt') + end + + it 'user views merge request plain diff' do + @merge_request.visit! + Page::MergeRequest::Show.perform(&:view_plain_diff) + + expect(page.text).to start_with('diff --git a/added_file.txt b/added_file.txt') + expect(page).to have_content('+File Added') + end + end + end +end |