diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-06-06 11:33:51 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-06-06 11:33:51 +0300 |
commit | 746c67dbd40bc15dab7713ea74996e17c8c75590 (patch) | |
tree | e0039a8424e854094fd650adb01fb78202a270ca /spec | |
parent | ec2a1ac5e57946817fdd98347f99d101235454f5 (diff) | |
parent | 4775fb9ea7e746a23f3077e333c9763b5e7e0bec (diff) |
Merge branch '47196-actionview-missingtemplate-missing-template-projects-merge_requests-invalid-projects-merge_requests-application-invalid-pr' into 'master'
Resolve "ActionView::MissingTemplate: Missing template projects/merge_requests/invalid, projects/merge_requests/application/invalid, pr..."
Closes #47196
See merge request gitlab-org/gitlab-ce!19356
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/projects/merge_requests_controller_spec.rb | 20 | ||||
-rw-r--r-- | spec/factories/merge_requests.rb | 6 |
2 files changed, 26 insertions, 0 deletions
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index 6e8de6db9c3..6e710c9b20b 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -80,6 +80,16 @@ describe Projects::MergeRequestsController do )) end end + + context "that is invalid" do + let(:merge_request) { create(:invalid_merge_request, target_project: project, source_project: project) } + + it "renders merge request page" do + go(format: :html) + + expect(response).to be_success + end + end end describe 'as json' do @@ -106,6 +116,16 @@ describe Projects::MergeRequestsController do expect(response).to match_response_schema('entities/merge_request_widget') end end + + context "that is invalid" do + let(:merge_request) { create(:invalid_merge_request, target_project: project, source_project: project) } + + it "renders merge request page" do + go(format: :json) + + expect(response).to be_success + end + end end describe "as diff" do diff --git a/spec/factories/merge_requests.rb b/spec/factories/merge_requests.rb index fab0ec22450..3441ce1b8cb 100644 --- a/spec/factories/merge_requests.rb +++ b/spec/factories/merge_requests.rb @@ -54,6 +54,11 @@ FactoryBot.define do state :opened end + trait :invalid do + source_branch "feature_one" + target_branch "feature_two" + end + trait :locked do state :locked end @@ -98,6 +103,7 @@ FactoryBot.define do factory :merged_merge_request, traits: [:merged] factory :closed_merge_request, traits: [:closed] factory :reopened_merge_request, traits: [:opened] + factory :invalid_merge_request, traits: [:invalid] factory :merge_request_with_diffs, traits: [:with_diffs] factory :merge_request_with_diff_notes do after(:create) do |mr| |