diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-11 03:06:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-11 03:06:26 +0300 |
commit | 991a295378736c60d419c794f0accbf0336987fc (patch) | |
tree | aaee5152256c8d4eb40a1583521bcf320082bb49 /spec/serializers | |
parent | 71d998ca0de672d5accdf209b4b5e3f360ea5267 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/diff_file_entity_spec.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/serializers/diff_file_entity_spec.rb b/spec/serializers/diff_file_entity_spec.rb index 0c2e7c1e3eb..65b62f8aa16 100644 --- a/spec/serializers/diff_file_entity_spec.rb +++ b/spec/serializers/diff_file_entity_spec.rb @@ -11,7 +11,8 @@ describe DiffFileEntity do let(:diff_refs) { commit.diff_refs } let(:diff) { commit.raw_diffs.first } let(:diff_file) { Gitlab::Diff::File.new(diff, diff_refs: diff_refs, repository: repository) } - let(:entity) { described_class.new(diff_file, request: {}) } + let(:options) { {} } + let(:entity) { described_class.new(diff_file, options.reverse_merge(request: {})) } subject { entity.as_json } @@ -23,7 +24,7 @@ describe DiffFileEntity do let(:user) { create(:user) } let(:request) { EntityRequest.new(project: project, current_user: user) } let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } - let(:entity) { described_class.new(diff_file, request: request, merge_request: merge_request) } + let(:entity) { described_class.new(diff_file, options.merge(request: request, merge_request: merge_request)) } let(:exposed_urls) { %i(edit_path view_path context_lines_path) } it_behaves_like 'diff file entity' @@ -49,6 +50,8 @@ describe DiffFileEntity do end context '#parallel_diff_lines' do + let(:options) { { diff_view: :parallel } } + it 'exposes parallel diff lines correctly' do response = subject |