diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 12:08:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 12:08:14 +0300 |
commit | ade18c9d68d5a2e6c6e28ef7e9d3add3b3491ace (patch) | |
tree | cf4154332fc95283f58cccb1383e43b40485d91d /spec/serializers/diff_file_entity_spec.rb | |
parent | ba836d98593d68d8d6c22c540e31c8031a786bd8 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/diff_file_entity_spec.rb')
-rw-r--r-- | spec/serializers/diff_file_entity_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/serializers/diff_file_entity_spec.rb b/spec/serializers/diff_file_entity_spec.rb index 3e341a58a15..e3ecd72b275 100644 --- a/spec/serializers/diff_file_entity_spec.rb +++ b/spec/serializers/diff_file_entity_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' describe DiffFileEntity do include RepoHelpers - let(:project) { create(:project, :repository) } + let_it_be(:project) { create(:project, :repository) } let(:repository) { project.repository } let(:commit) { project.commit(sample_commit.id) } let(:diff_refs) { commit.diff_refs } @@ -21,10 +21,11 @@ describe DiffFileEntity do end context 'when there is a merge request' do + let_it_be(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:user) { create(:user) } + let(:code_navigation_path) { Gitlab::CodeNavigationPath.new(project, project.commit.sha) } 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, options.merge(request: request, merge_request: merge_request)) } + let(:entity) { described_class.new(diff_file, options.merge(request: request, merge_request: merge_request, code_navigation_path: code_navigation_path)) } let(:exposed_urls) { %i(edit_path view_path context_lines_path) } it_behaves_like 'diff file entity' @@ -32,6 +33,7 @@ describe DiffFileEntity do it 'exposes additional attributes' do expect(subject).to include(*exposed_urls) expect(subject).to include(:replaced_view_path) + expect(subject).to include(:code_navigation_path) end it 'points all urls to merge request target project' do |