Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlazypanda committed Aug 30, 2020
1 parent 0081f28 commit bb8f70f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions test/functional/notes_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def teardown
}

assert_template 'print'
assert_select '#header', false
assert_select 'footer', false
assert_select '#content', false
assert_select '#note-title', note.title
assert_select '#content-window', note.body
assert_select '.info-date a', note.latest.author.name
assert_response :success
end

Expand Down
9 changes: 8 additions & 1 deletion test/functional/wiki_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def teardown
assert_equal flash[:notice], "Please post a question or other content before editing the wiki. Click <a href='https://publiclab.org/notes/tester/04-23-2016/new-moderation-system-for-first-time-posters'>here</a> to learn why."
assert_redirected_to nodes(:place).path
end

test 'updating wiki' do
wiki = nodes(:organizers)
newtitle = 'New Title'
Expand Down Expand Up @@ -684,6 +684,13 @@ def teardown

assert_template 'print'
assert_response :success
assert_select '#header', false
assert_select 'footer', false
assert_select '#content', false
#assert_select '.title', node.latest.title
#assert_select '.info-revision', node.revisions.length.to_s
#assert_select '.wi-author', node.author.username
#assert_select '.info-date a', node.latest.author.name
assert_select 'div#content-window', auto_link(insert_extras(node.latest.render_body), sanitize: false)[3..-6]
end
end
12 changes: 12 additions & 0 deletions test/system/print_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require "application_system_test_case"

class PrintTest < ApplicationSystemTestCase

test "open print in new tab" do
visit nodes(:one).path
find('#menu-btn').click()
find("#print-new").click()
assert page.driver.browser.window_handles.size == 2
end

end

0 comments on commit bb8f70f

Please sign in to comment.