wikis: fix exception when wiki doesn't have a tag.

Fix a nil reference exception in the sidebar when a wiki page doesn't
belong to a tag.

Also hide the options sidebar on the new wiki page since none of the
options are relevant when creating a new wiki.
This commit is contained in:
evazion
2022-09-12 21:16:52 -05:00
parent e1fb219738
commit 0267e4e3d7
2 changed files with 26 additions and 6 deletions

View File

@@ -97,6 +97,14 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end
should "render for a wiki without a tag" do
@wiki_page = create(:wiki_page, title: "help:foo")
get wiki_page_path(@wiki_page)
assert(@wiki_page.tag.nil?)
assert_response :success
end
should "show the 'does not exist' page for a nonexistent title" do
get wiki_page_path("what")