diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index a80db103a..8488c280c 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -132,7 +132,7 @@ class PostsController < ApplicationController raise ActiveRecord::RecordNotFound if @post.nil? authorize @post respond_with(@post) do |format| - format.html { redirect_to post_path(@post, :tags => params[:tags]) } + format.html { redirect_to post_path(@post, q: params[:tags]) } end end diff --git a/test/functional/posts_controller_test.rb b/test/functional/posts_controller_test.rb index 689d1e65f..126ea8098 100644 --- a/test/functional/posts_controller_test.rb +++ b/test/functional/posts_controller_test.rb @@ -498,14 +498,14 @@ class PostsControllerTest < ActionDispatch::IntegrationTest context "random action" do should "render" do get random_posts_path, params: { tags: "aaaa" } - assert_redirected_to(post_path(@post, tags: "aaaa")) + assert_redirected_to(post_path(@post, q: "aaaa")) end should "render for a ordfav: search" do @post = as(@user) { create(:post, tag_string: "fav:me") } get random_posts_path, params: { tags: "ordfav:#{@user.name}" } - assert_redirected_to(post_path(@post, tags: "ordfav:#{@user.name}")) + assert_redirected_to(post_path(@post, q: "ordfav:#{@user.name}")) end should "return a 404 when no random posts can be found" do