Skip to content

Commit

Permalink
Redirect atdis specification page
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Mar 5, 2024
1 parent 329139b commit 407fe56
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/controllers/atdis_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,9 @@ def feed
end

sig { void }
def specification; end
def specification
return unless show_tailwind_theme?

redirect_to "https://github.com/openaustralia/atdis/raw/master/docs/ATDIS-1.0.2%20Application%20Tracking%20Data%20Interchange%20Specification%20(v1.0.2).pdf"
end
end
14 changes: 13 additions & 1 deletion spec/requests/redirects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

it "redirects to the default sort option in the original design" do
get nearby_application_path(application)
# expect(response).not_to be_redirect
expect(response).to redirect_to nearby_application_path(application, sort: "time")
end

Expand All @@ -49,4 +48,17 @@
expect(response).to redirect_to application_path(application)
end
end

describe "atdis pages" do
it "does not redirect the specification page in the original design" do
get atdis_specification_path
expect(response).not_to be_redirect
end

it "redirects to the pdf document in the new design" do
sign_in create(:confirmed_user, tailwind_theme: true)
get atdis_specification_path
expect(response).to redirect_to "https://github.com/openaustralia/atdis/raw/master/docs/ATDIS-1.0.2%20Application%20Tracking%20Data%20Interchange%20Specification%20(v1.0.2).pdf"
end
end
end

0 comments on commit 407fe56

Please sign in to comment.