summaryrefslogtreecommitdiff
path: root/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb')
-rw-r--r--spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb40
1 files changed, 34 insertions, 6 deletions
diff --git a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
index d0d220fed66..080a53cc1a2 100644
--- a/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+++ b/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
@@ -96,10 +96,24 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end
describe 'Commits' do
- it 'has a link to the project commits path' do
- render
+ context 'when the use_ref_type_parameter flag is not enabled' do
+ before do
+ stub_feature_flags(use_ref_type_parameter: false)
+ end
- expect(rendered).to have_link('Commits', href: project_commits_path(project, current_ref), id: 'js-onboarding-commits-link')
+ it 'has a link to the project commits path' do
+ render
+
+ expect(rendered).to have_link('Commits', href: project_commits_path(project, current_ref), id: 'js-onboarding-commits-link')
+ end
+ end
+
+ context 'when the use_ref_type_parameter flag is enabled' do
+ it 'has a link to the fully qualified project commits path' do
+ render
+
+ expect(rendered).to have_link('Commits', href: project_commits_path(project, current_ref, ref_type: 'heads'), id: 'js-onboarding-commits-link')
+ end
end
end
@@ -120,10 +134,24 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end
describe 'Contributors' do
- it 'has a link to the project contributors path' do
- render
+ context 'and the use_ref_type_parameter flag is disabled' do
+ before do
+ stub_feature_flags(use_ref_type_parameter: false)
+ end
- expect(rendered).to have_link('Contributors', href: project_graph_path(project, current_ref))
+ it 'has a link to the project contributors path' do
+ render
+
+ expect(rendered).to have_link('Contributors', href: project_graph_path(project, current_ref))
+ end
+ end
+
+ context 'and the use_ref_type_parameter flag is enabled' do
+ it 'has a link to the project contributors path' do
+ render
+
+ expect(rendered).to have_link('Contributors', href: project_graph_path(project, current_ref, ref_type: 'heads'))
+ end
end
end