summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/integration/browser/account_test.rb14
-rw-r--r--test/support/browser_integration_test.rb4
2 files changed, 17 insertions, 1 deletions
diff --git a/test/integration/browser/account_test.rb b/test/integration/browser/account_test.rb
index 6d5f7f9..4e11520 100644
--- a/test/integration/browser/account_test.rb
+++ b/test/integration/browser/account_test.rb
@@ -123,6 +123,20 @@ class AccountTest < BrowserIntegrationTest
assert page.has_content?("server failed")
end
+ test "does not render signup form without js" do
+ Capybara.current_driver = :rack_test # no js
+ visit '/signup'
+ assert page.has_no_content?("Username")
+ assert page.has_no_content?("Password")
+ end
+
+ test "does not render login form without js" do
+ Capybara.current_driver = :rack_test # no js
+ visit '/login'
+ assert page.has_no_content?("Username")
+ assert page.has_no_content?("Password")
+ end
+
def attempt_login(username, password)
click_on 'Log In'
fill_in 'Username', with: username
diff --git a/test/support/browser_integration_test.rb b/test/support/browser_integration_test.rb
index 2885c3a..9cae8cb 100644
--- a/test/support/browser_integration_test.rb
+++ b/test/support/browser_integration_test.rb
@@ -60,7 +60,6 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest
end
def save_state
- page.save_screenshot screenshot_path
File.open(logfile_path, 'w') do |test_log|
test_log.puts self.class.name
test_log.puts "========================="
@@ -76,6 +75,9 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest
test_log.puts "------------------------"
test_log.puts `tail log/test.log -n 200`
end
+ page.save_screenshot screenshot_path
+ # some drivers do not support screenshots
+ rescue Capybara::NotSupportedByDriverError
end
end