posts: fix error when viewing nonexistent post IDs.
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%# XXX hack to only load Ruffle on Flash posts %>
|
<%# XXX hack to only load Ruffle on Flash posts %>
|
||||||
<% if controller_name == "posts" && action_name == "show" && @post.is_flash? %>
|
<% if controller_name == "posts" && action_name == "show" && @post&.is_flash? %>
|
||||||
<%= javascript_pack_tag "application", "flash" %>
|
<%= javascript_pack_tag "application", "flash" %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= javascript_pack_tag "application" %>
|
<%= javascript_pack_tag "application" %>
|
||||||
|
|||||||
@@ -567,6 +567,14 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "a nonexistent post id" do
|
||||||
|
should "return 404" do
|
||||||
|
get post_path(id: 9_999_999)
|
||||||
|
|
||||||
|
assert_response 404
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "with pools" do
|
context "with pools" do
|
||||||
should "render the pool list" do
|
should "render the pool list" do
|
||||||
as(@user) { @post.update(tag_string: "newpool:comic") }
|
as(@user) { @post.update(tag_string: "newpool:comic") }
|
||||||
|
|||||||
Reference in New Issue
Block a user