Skip to content

Commit

Permalink
ADD: system tests for wiki edits (#7254)
Browse files Browse the repository at this point in the history
* add system tests for wiki edits

* fix selector
  • Loading branch information
Uzay-G authored and jywarren committed Jan 16, 2020
1 parent 79cb162 commit 03ac17f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/system/post_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 03ac17f

Please sign in to comment.