diff --git a/app/controllers/atdis_controller.rb b/app/controllers/atdis_controller.rb index 5198aa0a3..8f94533cb 100644 --- a/app/controllers/atdis_controller.rb +++ b/app/controllers/atdis_controller.rb @@ -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 diff --git a/spec/requests/redirects_spec.rb b/spec/requests/redirects_spec.rb index 5cdf37504..1e70c39c2 100644 --- a/spec/requests/redirects_spec.rb +++ b/spec/requests/redirects_spec.rb @@ -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 @@ -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