diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 50abccd02..06531873a 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -166,7 +166,7 @@ class WikiPage < ApplicationRecord end def self.is_meta_wiki?(title) - title.starts_with?(*META_WIKIS) + title.present? && title.starts_with?(*META_WIKIS) end def is_meta_wiki? diff --git a/test/functional/wiki_pages_controller_test.rb b/test/functional/wiki_pages_controller_test.rb index b15310311..14022ec5d 100644 --- a/test/functional/wiki_pages_controller_test.rb +++ b/test/functional/wiki_pages_controller_test.rb @@ -92,6 +92,11 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest get_auth new_wiki_page_path, @mod, params: { wiki_page: { title: "test" }} assert_response :success end + + should "render without a title" do + get_auth new_wiki_page_path, @mod + assert_response :success + end end context "edit action" do