Commit 6ada3a3b authored by Mark Lapierre's avatar Mark Lapierre

Merge branch 'qa-create-view_merge_request' into 'master'

Remove test from quarantine

Closes gitlab-org/quality/staging#55

See merge request gitlab-org/gitlab-ee!14336
parents 19c661f8 42aed943
......@@ -5,7 +5,8 @@ require 'securerandom'
module QA
module Resource
class MergeRequest < Base
attr_accessor :title,
attr_accessor :id,
:title,
:description,
:source_branch,
:target_branch,
......@@ -71,6 +72,28 @@ module QA
page.create_merge_request
end
end
def fabricate_via_api!
populate(:target, :source)
super
end
def api_get_path
"/projects/#{project.id}/merge_requests/#{id}"
end
def api_post_path
"/projects/#{project.id}/merge_requests"
end
def api_post_body
{
description: @description,
source_branch: @source_branch,
target_branch: @target_branch,
title: @title
}
end
end
end
end
# frozen_string_literal: true
module QA
# https://gitlab.com/gitlab-org/quality/staging/issues/55
context 'Create', :quarantine do
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|
project = Resource::Project.fabricate_via_api! do |project|
project.name = 'project'
end
@merge_request = Resource::MergeRequest.fabricate_via_api! do |merge_request|
merge_request.project = project
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
it 'user views merge request email patches' do
it 'views the merge request email patches' do
@merge_request.visit!
Page::MergeRequest::Show.perform(&:view_email_patches)
......@@ -23,7 +27,7 @@ module QA
expect(page).to have_content('diff --git a/added_file.txt b/added_file.txt')
end
it 'user views merge request plain diff' do
it 'views the merge request plain diff' do
@merge_request.visit!
Page::MergeRequest::Show.perform(&:view_plain_diff)
......
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