aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/layouts/default.html.erb2
-rw-r--r--spec/integration/view_request_spec.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb
index 32ea5e4ff..688816fa9 100644
--- a/app/views/layouts/default.html.erb
+++ b/app/views/layouts/default.html.erb
@@ -33,7 +33,7 @@
<% end %>
<% end %>
<% if @has_json %>
- <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h url_for(request.query_parameters.merge(:format => 'json')) %>">
+ <link rel="alternate" type="application/json" title="JSON version of this page" href="<%=h url_for(request.params.merge(:format => 'json')) %>">
<% end %>
<% if @no_crawl %>
diff --git a/spec/integration/view_request_spec.rb b/spec/integration/view_request_spec.rb
index 442721890..3d646cfe7 100644
--- a/spec/integration/view_request_spec.rb
+++ b/spec/integration/view_request_spec.rb
@@ -13,5 +13,12 @@ describe "When viewing requests" do
response.body.should include("dog.json?unfold=1")
end
+ it 'should not raise a routing error when making a json link for a request with an
+ "action" querystring param' do
+ @dog_request = info_requests(:fancy_dog_request)
+ get "request/#{@dog_request.url_title}?action=add"
+ response.should be_success
+ end
+
end