From 0ccfb3f5f6e861664936f7d75adc5b84df1a9098 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 31 Oct 2019 03:27:11 -0500 Subject: [PATCH] wiki pages: fix error in new controller action. --- app/models/wiki_page.rb | 2 +- test/functional/wiki_pages_controller_test.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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