diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-26 00:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-26 00:09:03 +0300 |
commit | fba5aaeec6f0e95818092f7b27b1529df1c13b63 (patch) | |
tree | c0e9f33e1b9cabccd12f57ad2da427af1a31d1c4 /spec/serializers/diffs_entity_spec.rb | |
parent | 899bb5c4a9e249e2051bb564eeb17d1456b5ae8d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/diffs_entity_spec.rb')
-rw-r--r-- | spec/serializers/diffs_entity_spec.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/serializers/diffs_entity_spec.rb b/spec/serializers/diffs_entity_spec.rb index 7569493573b..a7446f14745 100644 --- a/spec/serializers/diffs_entity_spec.rb +++ b/spec/serializers/diffs_entity_spec.rb @@ -3,10 +3,11 @@ require 'spec_helper' RSpec.describe DiffsEntity do - let(:user) { create(:user) } - let(:project) { create(:project, :repository) } + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project, :repository) } + let_it_be(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) } + let(:request) { EntityRequest.new(project: project, current_user: user) } - let(:merge_request) { create(:merge_request_with_diffs, target_project: project, source_project: project) } let(:merge_request_diffs) { merge_request.merge_request_diffs } let(:options) do { request: request, merge_request: merge_request, merge_request_diffs: merge_request_diffs } @@ -30,6 +31,14 @@ RSpec.describe DiffsEntity do ) end + context 'broken merge request' do + let(:merge_request) { create(:merge_request, :invalid, target_project: project, source_project: project) } + + it 'renders without errors' do + expect { subject }.not_to raise_error + end + end + context "when a commit_id is passed" do let(:commits) { merge_request.commits } let(:entity) do |