Skip to content

Commit

Permalink
Redirect will always use ID not slug
Browse files Browse the repository at this point in the history
  • Loading branch information
fbacall committed Dec 10, 2024
1 parent 7063644 commit abeb0d7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/integration/identifier_resolution_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class IdentifierResolutionTest < ActionDispatch::IntegrationTest

get "/resolve/e#{event.id}"

assert_redirected_to event
assert_redirected_to event_path(event.id)

follow_redirect!

Expand All @@ -19,35 +19,35 @@ class IdentifierResolutionTest < ActionDispatch::IntegrationTest

get "/resolve/m#{material.id}"

assert_redirected_to material
assert_redirected_to material_path(material.id)
end

test 'resolve content provider' do
content_provider = content_providers(:goblet)

get "/resolve/p#{content_provider.id}"

assert_redirected_to content_provider
assert_redirected_to content_provider_path(content_provider.id)
end

test 'resolve workflow' do
workflow = workflows(:two)

get "/resolve/w#{workflow.id}"

assert_redirected_to workflow
assert_redirected_to workflow_path(workflow.id)
end

test 'ignores prefix when resolving' do
material = materials(:good_material)

get "/resolve/tess:m#{material.id}"

assert_redirected_to material
assert_redirected_to material_path(material.id)

get "/resolve/batman:m#{material.id}"

assert_redirected_to material
assert_redirected_to material_path(material.id)
end

test 'does not resolve bad identifier' do
Expand Down

0 comments on commit abeb0d7

Please sign in to comment.