related tags: fix exception on copyright tags with nonexistent wiki pages.

This commit is contained in:
evazion
2019-10-14 23:13:49 -05:00
parent eb2bec95fa
commit 1ca4add525
2 changed files with 7 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ require 'test_helper'
class RelatedTagsControllerTest < ActionDispatch::IntegrationTest
context "The related tags controller" do
setup do
create(:post, tag_string: "touhou")
create(:post, tag_string: "copy:touhou")
end
context "show action" do
@@ -16,6 +16,11 @@ class RelatedTagsControllerTest < ActionDispatch::IntegrationTest
get related_tag_path(format: :json), params: { query: "touhou" }
assert_response :success
end
should "work for .js responses for copyright tags without a wiki" do
get related_tag_path(format: :js), params: { query: "touhou" }, xhr: true
assert_response :success
end
end
end
end