diff options
Diffstat (limited to 'spec/views/projects')
-rw-r--r-- | spec/views/projects/issues/_service_desk_info_content.html.haml_spec.rb | 2 | ||||
-rw-r--r-- | spec/views/projects/settings/integrations/edit.html.haml_spec.rb (renamed from spec/views/projects/services/edit.html.haml_spec.rb) | 2 | ||||
-rw-r--r-- | spec/views/projects/tags/index.html.haml_spec.rb | 33 |
3 files changed, 31 insertions, 6 deletions
diff --git a/spec/views/projects/issues/_service_desk_info_content.html.haml_spec.rb b/spec/views/projects/issues/_service_desk_info_content.html.haml_spec.rb index 1c6d729ddce..92ca0bb52d6 100644 --- a/spec/views/projects/issues/_service_desk_info_content.html.haml_spec.rb +++ b/spec/views/projects/issues/_service_desk_info_content.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'projects/issues/_service_desk_info_content' do +RSpec.describe 'projects/issues/service_desk/_service_desk_info_content' do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user) } let_it_be(:service_desk_address) { 'address@example.com' } diff --git a/spec/views/projects/services/edit.html.haml_spec.rb b/spec/views/projects/settings/integrations/edit.html.haml_spec.rb index 372ccf82a68..5f3c45166ef 100644 --- a/spec/views/projects/services/edit.html.haml_spec.rb +++ b/spec/views/projects/settings/integrations/edit.html.haml_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'projects/services/edit' do +RSpec.describe 'projects/settings/integrations/edit' do let(:integration) { create(:drone_ci_integration, project: project) } let(:project) { create(:project) } diff --git a/spec/views/projects/tags/index.html.haml_spec.rb b/spec/views/projects/tags/index.html.haml_spec.rb index ae59c1aa4b2..aff233b697f 100644 --- a/spec/views/projects/tags/index.html.haml_spec.rb +++ b/spec/views/projects/tags/index.html.haml_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' RSpec.describe 'projects/tags/index.html.haml' do let_it_be(:project) { create(:project, :repository) } - let_it_be(:tags) { project.repository.tags } let_it_be(:git_tag) { project.repository.tags.last } let_it_be(:release) do create(:release, project: project, @@ -25,9 +24,31 @@ RSpec.describe 'projects/tags/index.html.haml' do allow(view).to receive(:current_user).and_return(project.namespace.owner) end - it 'renders links to the Releases page for tags associated with a release' do - render - expect(rendered).to have_link(release.name, href: project_releases_path(project, anchor: release.tag)) + context 'when tag is associated with a release' do + context 'when name does not contain a backslash' do + it 'renders a link to the release page' do + render + expect(rendered).to have_link(release.name, href: project_release_path(project, release)) + end + end + + context 'when name contains backslash' do + let_it_be(:release) { create(:release, project: project, tag: 'test/v1') } + + before_all do + project.repository.add_tag(project.owner, 'test/v1', project.default_branch_or_main) + project.repository.expire_tags_cache + + project.releases.reload + + assign(:tags, Kaminari.paginate_array(tags).page(0)) + end + + it 'renders a link to the release page with backslash escaped' do + render + expect(rendered).to have_link(release.name, href: project_release_path(project, release)) + end + end end context 'when the most recent build for a tag has artifacts' do @@ -104,4 +125,8 @@ RSpec.describe 'projects/tags/index.html.haml' do ) end end + + def tags + project.repository.tags + end end |