diff options
author | Azul <azul@leap.se> | 2012-11-04 16:24:35 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-11-04 16:24:35 +0100 |
commit | 5c6395d8b1a8c7cf540dae9fdd37f3e68554215c (patch) | |
tree | 727cd51d00addfb26ebbfc9a75d890513b709930 | |
parent | 2264623a445bf5c64404ef302f63e4d99ecbd97f (diff) |
fixing tests, including support files from all engines
-rw-r--r-- | test/dummy/app/controllers/application_controller.rb | 5 | ||||
-rw-r--r-- | test/test_helper.rb | 3 | ||||
-rw-r--r-- | users/test/integration/api/account_flow_test.rb | 2 | ||||
-rw-r--r-- | users/test/support/auth_test_helper.rb | 4 | ||||
-rw-r--r-- | users/test/test_helper.rb | 4 | ||||
-rw-r--r-- | users/test/unit/user_test.rb | 2 |
6 files changed, 14 insertions, 6 deletions
diff --git a/test/dummy/app/controllers/application_controller.rb b/test/dummy/app/controllers/application_controller.rb new file mode 100644 index 0000000..be7aa1f --- /dev/null +++ b/test/dummy/app/controllers/application_controller.rb @@ -0,0 +1,5 @@ +class ApplicationController < ActionController::Base + protect_from_forgery + + ActiveSupport.run_load_hooks(:application_controller, self) +end diff --git a/test/test_helper.rb b/test/test_helper.rb index f7d48ec..50d5159 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,6 +4,9 @@ require 'rails/test_help' require 'mocha' +# Load support files from all engines +Dir["#{File.dirname(__FILE__)}/../*/test/support/**/*.rb"].each { |f| require f } + class ActiveSupport::TestCase # Add more helper methods to be used by all tests here... end diff --git a/users/test/integration/api/account_flow_test.rb b/users/test/integration/api/account_flow_test.rb index 66de1e5..5800d46 100644 --- a/users/test/integration/api/account_flow_test.rb +++ b/users/test/integration/api/account_flow_test.rb @@ -39,7 +39,7 @@ class AccountFlowTest < ActionDispatch::IntegrationTest end test "signup response" do - assert_json_response @user_params.slice(:login, :password_salt) + assert_json_response :login => @login, :ok => true assert_response :success end diff --git a/users/test/support/auth_test_helper.rb b/users/test/support/auth_test_helper.rb index d5d52b1..9412058 100644 --- a/users/test/support/auth_test_helper.rb +++ b/users/test/support/auth_test_helper.rb @@ -23,3 +23,7 @@ module AuthTestHelper end end end + +class ActionController::TestCase + include AuthTestHelper +end diff --git a/users/test/test_helper.rb b/users/test/test_helper.rb index ae6a35c..e8f0125 100644 --- a/users/test/test_helper.rb +++ b/users/test/test_helper.rb @@ -7,7 +7,3 @@ Rails.backtrace_cleaner.remove_silencers! # Load support files Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } - -class ActionController::TestCase - include AuthTestHelper -end diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb index 822ef33..f057ca7 100644 --- a/users/test/unit/user_test.rb +++ b/users/test/unit/user_test.rb @@ -19,7 +19,7 @@ class UserTest < ActiveSupport::TestCase end test "test require alphanumerical for login" do - @user.login = "qwär" + @user.login = "qw#r" assert !@user.valid? end |