From 03ac17f48197fbcb4eacb6794604e014b8881306 Mon Sep 17 00:00:00 2001 From: Uzay-G <52892257+Uzay-G@users.noreply.github.com> Date: Thu, 16 Jan 2020 23:39:52 +0100 Subject: [PATCH] ADD: system tests for wiki edits (#7254) * add system tests for wiki edits * fix selector --- test/system/post_test.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/system/post_test.rb b/test/system/post_test.rb index 49f25555e2..ffe3da7416 100644 --- a/test/system/post_test.rb +++ b/test/system/post_test.rb @@ -91,5 +91,24 @@ def assert_page_does_not_reload(message = "page should not reload") page.evaluate_script "document.body.classList.remove('not-reloaded')" end + test "edit wiki" do + visit '/wiki/wiki-page-path/' + click_on "Login" + + fill_in 'user_session[username]', with: 'jeff' + fill_in 'user_session[password]', with: 'secretive' + click_on "Log in" + find('a.btn-circle:first-of-type .fa-pencil').click() + fill_in("body", with: "Test for editing wikis!") + + # preview edits + find("a.preview-btn").click() + assert find("p", text: "Test for editing wikis!") + + # publish edits + find("#publish").click() + assert find("p", text: "Test for editing wikis!") + assert find("div.alert-success", text: "Edits saved.") + end end