diff options
author | Azul <azul@leap.se> | 2013-04-03 11:21:00 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-04-03 11:21:00 +0200 |
commit | f4172ac9ea7a484659fa2019119533bc9569880f (patch) | |
tree | 02e068a8b231ef950c60ddf88f7ba28747ac1e98 /users/test | |
parent | d781dbdd61d1d24ec4828859a28815b55310154d (diff) |
fixed tests to use setup and teardown blocks
Diffstat (limited to 'users/test')
-rw-r--r-- | users/test/integration/api/account_flow_test.rb | 17 | ||||
-rw-r--r-- | users/test/integration/api/login_test.rb | 15 |
2 files changed, 7 insertions, 25 deletions
diff --git a/users/test/integration/api/account_flow_test.rb b/users/test/integration/api/account_flow_test.rb index d1a97e9..1698105 100644 --- a/users/test/integration/api/account_flow_test.rb +++ b/users/test/integration/api/account_flow_test.rb @@ -1,18 +1,9 @@ require 'test_helper' +require_relative 'rack_test' -CONFIG_RU = (Rails.root + 'config.ru').to_s -OUTER_APP = Rack::Builder.parse_file(CONFIG_RU).first +class AccountFlowTest < RackTest -class AccountFlowTest < ActiveSupport::TestCase - include Rack::Test::Methods - include Warden::Test::Helpers - include LeapWebCore::AssertResponses - - def app - OUTER_APP - end - - def setup + setup do @login = "integration_test_user" User.find_by_login(@login).tap{|u| u.destroy if u} @password = "srp, verify me!" @@ -26,7 +17,7 @@ class AccountFlowTest < ActiveSupport::TestCase @user = User.find_by_login(@login) end - def teardown + teardown do @user.destroy if @user Warden.test_reset! end diff --git a/users/test/integration/api/login_test.rb b/users/test/integration/api/login_test.rb index ba82c8e..fb761e5 100644 --- a/users/test/integration/api/login_test.rb +++ b/users/test/integration/api/login_test.rb @@ -1,18 +1,9 @@ require 'test_helper' +require_relative 'rack_test' -CONFIG_RU = (Rails.root + 'config.ru').to_s -OUTER_APP = Rack::Builder.parse_file(CONFIG_RU).first +class AccountFlowTest < RackTest -class AccountFlowTest < ActiveSupport::TestCase - include Rack::Test::Methods - include Warden::Test::Helpers - include LeapWebCore::AssertResponses - - def app - OUTER_APP - end - - def setup + setup do @login = "integration_test_user" end |