diff options
author | azul <azul@riseup.net> | 2014-05-14 08:41:13 +0200 |
---|---|---|
committer | azul <azul@riseup.net> | 2014-05-14 08:41:13 +0200 |
commit | c85028fba2a25f22b375b8714c2e1999c35f8e82 (patch) | |
tree | e9c6a5c25e0bb7acaddae1f34a9fd0de886bbeb8 /test/support | |
parent | 4843db127a5d5d038f227d9ffe5f0b83d95fd9f6 (diff) | |
parent | 3278e474a32ef4926b1dab0d97ca4df1c59aa2a0 (diff) |
Merge pull request #157 from azul/bugfix/5664-stop-email-autofill
Bugfix/5664 stop email autofill
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/browser_integration_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/support/browser_integration_test.rb b/test/support/browser_integration_test.rb index 9cae8cb..1c872ff 100644 --- a/test/support/browser_integration_test.rb +++ b/test/support/browser_integration_test.rb @@ -53,6 +53,21 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest return username, password end + # currently this only works for tests with poltergeist. + def login(user = nil) + @user ||= user ||= FactoryGirl.create(:user) + token = Token.create user_id: user.id + page.driver.add_header "Authorization", %Q(Token token="#{token}") + visit '/' + end + + teardown do + if @user && @user.reload + Identity.destroy_all_for @user + @user.destroy + end + end + add_teardown_hook do |testcase| unless testcase.passed? testcase.save_state |