diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-06-29 20:06:35 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-07-05 19:11:59 +0300 |
commit | fe13f110412d85c05dc68e5ee1db499f681bf722 (patch) | |
tree | 4a2d172bb5a490ac8cadbcf376fbf815393ef22b /spec/lib/banzai/filter/merge_request_reference_filter_spec.rb | |
parent | dc7939337e0d72d2391c3bbb3082d644a54195af (diff) |
Create and use project path helpers that only need a project, no namespace
Diffstat (limited to 'spec/lib/banzai/filter/merge_request_reference_filter_spec.rb')
-rw-r--r-- | spec/lib/banzai/filter/merge_request_reference_filter_spec.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/spec/lib/banzai/filter/merge_request_reference_filter_spec.rb b/spec/lib/banzai/filter/merge_request_reference_filter_spec.rb index cd91681551e..1ad329b6452 100644 --- a/spec/lib/banzai/filter/merge_request_reference_filter_spec.rb +++ b/spec/lib/banzai/filter/merge_request_reference_filter_spec.rb @@ -37,7 +37,7 @@ describe Banzai::Filter::MergeRequestReferenceFilter, lib: true do doc = reference_filter("See #{reference}") expect(doc.css('a').first.attr('href')).to eq urls - .namespace_project_merge_request_url(project.namespace, project, merge) + .project_merge_request_url(project, merge) end it 'links with adjacent text' do @@ -95,7 +95,7 @@ describe Banzai::Filter::MergeRequestReferenceFilter, lib: true do link = doc.css('a').first.attr('href') expect(link).not_to match %r(https?://) - expect(link).to eq urls.namespace_project_merge_request_url(project.namespace, project, merge, only_path: true) + expect(link).to eq urls.project_merge_request_url(project, merge, only_path: true) end end @@ -108,8 +108,7 @@ describe Banzai::Filter::MergeRequestReferenceFilter, lib: true do doc = reference_filter("See #{reference}") expect(doc.css('a').first.attr('href')) - .to eq urls.namespace_project_merge_request_url(project2.namespace, - project2, merge) + .to eq urls.project_merge_request_url(project2, merge) end it 'link has valid text' do @@ -142,8 +141,7 @@ describe Banzai::Filter::MergeRequestReferenceFilter, lib: true do doc = reference_filter("See #{reference}") expect(doc.css('a').first.attr('href')) - .to eq urls.namespace_project_merge_request_url(project2.namespace, - project2, merge) + .to eq urls.project_merge_request_url(project2, merge) end it 'link has valid text' do @@ -176,8 +174,7 @@ describe Banzai::Filter::MergeRequestReferenceFilter, lib: true do doc = reference_filter("See #{reference}") expect(doc.css('a').first.attr('href')) - .to eq urls.namespace_project_merge_request_url(project2.namespace, - project2, merge) + .to eq urls.project_merge_request_url(project2, merge) end it 'link has valid text' do @@ -203,7 +200,7 @@ describe Banzai::Filter::MergeRequestReferenceFilter, lib: true do let(:namespace) { create(:namespace, name: 'cross-reference') } let(:project2) { create(:empty_project, :public, namespace: namespace) } let(:merge) { create(:merge_request, source_project: project2, target_project: project2) } - let(:reference) { urls.namespace_project_merge_request_url(project2.namespace, project2, merge) + '/diffs#note_123' } + let(:reference) { urls.project_merge_request_url(project2, merge) + '/diffs#note_123' } it 'links to a valid reference' do doc = reference_filter("See #{reference}") |