test/integration/viewer_test.rb in pdfjs_viewer-rails-0.2.0 vs test/integration/viewer_test.rb in pdfjs_viewer-rails-0.3.0
- old
+ new
@@ -7,10 +7,11 @@
test "Full viewer" do
visit "/"
output = capture(:stdout) do
click_on "full viewer"
+ assert has_selector?("#pdfjs_viewer-full")
assert_equal 1, all("#pdfjs_viewer-full").size
sleep @time_to_render
end
assert_rendered_pdf output, screenshot: SANDBOX_PATH + "full_viewer.png"
@@ -18,10 +19,11 @@
test "Reduced viewer" do
visit "/"
output = capture(:stdout) do
click_on "reduced viewer"
+ assert has_selector?("#pdfjs_viewer-reduced")
assert_equal 1, all("#pdfjs_viewer-reduced").size
sleep @time_to_render
end
assert_rendered_pdf output, screenshot: SANDBOX_PATH + "reduced_viewer.png"
@@ -29,10 +31,11 @@
test "Minimal viewer" do
visit "/"
output = capture(:stdout) do
click_on "minimal viewer"
+ assert has_selector?("#pdfjs_viewer-minimal")
assert_equal 1, all("#pdfjs_viewer-minimal").size
sleep @time_to_render
end
assert_rendered_pdf output, screenshot: SANDBOX_PATH + "minimal_viewer.png"
@@ -40,10 +43,11 @@
test "Using the helper" do
visit "/"
output = capture(:stdout) do
click_on "helper"
+ assert has_selector?("#pdfjs_viewer-minimal")
assert_equal 1, all("#pdfjs_viewer-minimal").size
sleep @time_to_render
end
assert_rendered_pdf output, screenshot: SANDBOX_PATH + "helper.png"
@@ -67,9 +71,10 @@
ENV["PDFJS_VIEWER_VERBOSITY"] = level.to_s
capture(:stdout) do
visit "/"
click_on "full viewer"
end
+ sleep @time_to_render
assert_equal number, page.evaluate_script("PDFJS.verbosity")
end
ensure
ENV.delete("PDFJS_VIEWER_VERBOSITY")
end