wiki pages: fix error when force renaming wiki page.

Bug: force renaming a wiki page fails. Fix: use the wiki page id instead
of the title in the update action.
This commit is contained in:
evazion
2019-11-06 15:07:02 -06:00
parent 19549e2c12
commit 70b6525e69
4 changed files with 33 additions and 8 deletions

View File

@@ -0,0 +1,19 @@
require "application_system_test_case"
class WikiPagesTest < ApplicationSystemTestCase
context "renaming a wiki" do
should "work" do
@user = create(:user, level: User::Levels::BUILDER, created_at: 1.month.ago)
@wiki = as(@user) { create(:wiki_page, title: "kancolle") }
signin @user
visit wiki_page_path(@wiki)
click_on "Edit"
fill_in "Title", with: "kantai_collection"
click_on "Submit"
assert_selector "#wiki-page-title", text: "kantai collection"
assert_equal("kantai_collection", @wiki.reload.title)
end
end
end