diff options
Diffstat (limited to 'spec/features/projects/issues')
-rw-r--r-- | spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb | 29 | ||||
-rw-r--r-- | spec/features/projects/issues/viewing_relocated_issues_spec.rb | 40 |
2 files changed, 40 insertions, 29 deletions
diff --git a/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb b/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb index 8d5e99d7e2b..78fb470d4ea 100644 --- a/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb +++ b/spec/features/projects/issues/design_management/user_links_to_designs_in_issue_spec.rb @@ -90,34 +90,5 @@ RSpec.describe 'viewing issues with design references' do expect(page).not_to have_link(design_ref_b) end end - - context 'design management is enabled, but the filter is disabled globally' do - before do - enable_design_management - stub_feature_flags( - Banzai::Filter::DesignReferenceFilter::FEATURE_FLAG => false - ) - end - - it 'processes design tab links successfully, and design references as issue references', :aggregate_failures do - visit_page_with_design_references - - expect(page).to have_text('The designs I mentioned') - expect(page).to have_link(design_tab_ref) - expect(page).to have_link(issue_ref) - expect(page).not_to have_link(design_ref_a) - expect(page).not_to have_link(design_ref_b) - end - end - - context 'design management is enabled, and the filter is enabled for the current project' do - before do - stub_feature_flags( - Banzai::Filter::DesignReferenceFilter::FEATURE_FLAG => public_project - ) - end - - it_behaves_like 'successful use of design link references' - end end end diff --git a/spec/features/projects/issues/viewing_relocated_issues_spec.rb b/spec/features/projects/issues/viewing_relocated_issues_spec.rb new file mode 100644 index 00000000000..10d5ad1747c --- /dev/null +++ b/spec/features/projects/issues/viewing_relocated_issues_spec.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'issues canonical link' do + include Spec::Support::Helpers::Features::CanonicalLinkHelpers + + let_it_be(:original_project) { create(:project, :public) } + let_it_be(:original_issue) { create(:issue, project: original_project) } + let_it_be(:canonical_issue) { create(:issue) } + let_it_be(:canonical_url) { issue_url(canonical_issue, Gitlab::Application.routes.default_url_options) } + + it "doesn't show the canonical URL" do + visit(issue_path(original_issue)) + + expect(page).not_to have_any_canonical_links + end + + context 'when the issue was moved' do + it 'shows the canonical URL' do + original_issue.moved_to = canonical_issue + original_issue.save! + + visit(issue_path(original_issue)) + + expect(page).to have_canonical_link(canonical_url) + end + end + + context 'when the issue was duplicated' do + it 'shows the canonical URL' do + original_issue.duplicated_to = canonical_issue + original_issue.save! + + visit(issue_path(original_issue)) + + expect(page).to have_canonical_link(canonical_url) + end + end +end |