summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--users/test/integration/api/account_flow_test.rb17
-rw-r--r--users/test/integration/api/login_test.rb15
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