test/integration/viewer_test.rb in pdfjs_viewer-rails-0.1.0 vs test/integration/viewer_test.rb in pdfjs_viewer-rails-0.2.0

- old
+ new

@@ -47,19 +47,29 @@ end assert_rendered_pdf output, screenshot: SANDBOX_PATH + "helper.png" end + test "extra_head is rendered into the head of the viewer" do + visit "/" + capture(:stdout) do + click_on "helper" + assert_equal "1", find('meta[name="example"]', visible: false)[:content] + end + end + test "pdfjs viewer verbosity is set with ENV variable" do begin { errors: 0, warnings: 1, infos: 5 }.each do |level, number| ENV["PDFJS_VIEWER_VERBOSITY"] = level.to_s - visit "/" - click_on "full viewer" + capture(:stdout) do + visit "/" + click_on "full viewer" + end assert_equal number, page.evaluate_script("PDFJS.verbosity") end ensure ENV.delete("PDFJS_VIEWER_VERBOSITY") end