diff --git a/Rakefile b/Rakefile index afed9003..36b6798f 100644 --- a/Rakefile +++ b/Rakefile @@ -37,7 +37,7 @@ begin require 'jeweler' Jeweler::Tasks.new do |s| s.name = "devise" - s.version = Devise::VERSION + s.version = Devise::VERSION.dup s.summary = "Flexible authentication solution for Rails with Warden" s.email = "contact@plataformatec.com.br" s.homepage = "http://github.com/plataformatec/devise" diff --git a/TODO b/TODO index b3b0488d..3182d2e4 100644 --- a/TODO +++ b/TODO @@ -1,2 +1,2 @@ -* Make test run with DataMapper * Extract Activatable tests from Confirmable +* Move integration tests to Capybara diff --git a/test/controllers/helpers_test.rb b/test/controllers/helpers_test.rb index c863ada5..34336f03 100644 --- a/test/controllers/helpers_test.rb +++ b/test/controllers/helpers_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' require 'ostruct' class MockController < ApplicationController diff --git a/test/controllers/internal_helpers_test.rb b/test/controllers/internal_helpers_test.rb index 4c9ec7c4..242575d8 100644 --- a/test/controllers/internal_helpers_test.rb +++ b/test/controllers/internal_helpers_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class MyController < ApplicationController include Devise::Controllers::InternalHelpers @@ -7,6 +7,11 @@ end class HelpersTest < ActionController::TestCase tests MyController + def setup + @mock_warden = OpenStruct.new + @controller.request.env['warden'] = @mock_warden + end + test 'get resource name from request path' do @request.path = '/users/session' assert_equal :user, @controller.resource_name diff --git a/test/controllers/url_helpers_test.rb b/test/controllers/url_helpers_test.rb index 9344c2de..1fad5be0 100644 --- a/test/controllers/url_helpers_test.rb +++ b/test/controllers/url_helpers_test.rb @@ -1,9 +1,9 @@ -require 'test/test_helper' +require 'test_helper' class RoutesTest < ActionController::TestCase tests ApplicationController - def test_path_and_url(name, prepend_path=nil) + def assert_path_and_url(name, prepend_path=nil) @request.path = '/users/session' prepend_path = "#{prepend_path}_" if prepend_path @@ -29,19 +29,19 @@ class RoutesTest < ActionController::TestCase test 'should alias session to mapped user session' do - test_path_and_url :session - test_path_and_url :session, :new - test_path_and_url :session, :destroy + assert_path_and_url :session + assert_path_and_url :session, :new + assert_path_and_url :session, :destroy end test 'should alias password to mapped user password' do - test_path_and_url :password - test_path_and_url :password, :new - test_path_and_url :password, :edit + assert_path_and_url :password + assert_path_and_url :password, :new + assert_path_and_url :password, :edit end test 'should alias confirmation to mapped user confirmation' do - test_path_and_url :confirmation - test_path_and_url :confirmation, :new + assert_path_and_url :confirmation + assert_path_and_url :confirmation, :new end end diff --git a/test/devise_test.rb b/test/devise_test.rb index 5607bab0..c651bf74 100644 --- a/test/devise_test.rb +++ b/test/devise_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' module Devise def self.clean_warden_config! diff --git a/test/encryptors_test.rb b/test/encryptors_test.rb index 1010b3e8..62e9659e 100644 --- a/test/encryptors_test.rb +++ b/test/encryptors_test.rb @@ -1,3 +1,5 @@ +require 'test_helper' + class Encryptors < ActiveSupport::TestCase test 'should match a password created by authlogic' do authlogic = "b623c3bc9c775b0eb8edb218a382453396fec4146422853e66ecc4b6bc32d7162ee42074dcb5f180a770dc38b5df15812f09bbf497a4a1b95fe5e7d2b8eb7eb4" diff --git a/test/failure_app_test.rb b/test/failure_app_test.rb index 17cfd0d2..a1037fac 100644 --- a/test/failure_app_test.rb +++ b/test/failure_app_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' require 'ostruct' class FailureTest < ActiveSupport::TestCase diff --git a/test/integration/authenticatable_test.rb b/test/integration/authenticatable_test.rb index e43b3504..6d4222aa 100644 --- a/test/integration/authenticatable_test.rb +++ b/test/integration/authenticatable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class AuthenticationSanityTest < ActionController::IntegrationTest test 'home should be accessible without sign in' do diff --git a/test/integration/confirmable_test.rb b/test/integration/confirmable_test.rb index cccf32d4..46338dc3 100644 --- a/test/integration/confirmable_test.rb +++ b/test/integration/confirmable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class ConfirmationTest < ActionController::IntegrationTest diff --git a/test/integration/http_authenticatable_test.rb b/test/integration/http_authenticatable_test.rb index e843930f..e55e0965 100644 --- a/test/integration/http_authenticatable_test.rb +++ b/test/integration/http_authenticatable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class HttpAuthenticationTest < ActionController::IntegrationTest diff --git a/test/integration/lockable_test.rb b/test/integration/lockable_test.rb index 0bf7e26a..8b59161a 100644 --- a/test/integration/lockable_test.rb +++ b/test/integration/lockable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class LockTest < ActionController::IntegrationTest diff --git a/test/integration/recoverable_test.rb b/test/integration/recoverable_test.rb index 5642e0e9..52abdbb9 100644 --- a/test/integration/recoverable_test.rb +++ b/test/integration/recoverable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class PasswordTest < ActionController::IntegrationTest diff --git a/test/integration/registerable_test.rb b/test/integration/registerable_test.rb index 78c23807..7d537dc7 100644 --- a/test/integration/registerable_test.rb +++ b/test/integration/registerable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class RegistrationTest < ActionController::IntegrationTest diff --git a/test/integration/rememberable_test.rb b/test/integration/rememberable_test.rb index 087c8fdb..4e9c3479 100644 --- a/test/integration/rememberable_test.rb +++ b/test/integration/rememberable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class RememberMeTest < ActionController::IntegrationTest diff --git a/test/integration/timeoutable_test.rb b/test/integration/timeoutable_test.rb index d274d2f6..2f7d88e9 100644 --- a/test/integration/timeoutable_test.rb +++ b/test/integration/timeoutable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class SessionTimeoutTest < ActionController::IntegrationTest diff --git a/test/integration/token_authenticatable_test.rb b/test/integration/token_authenticatable_test.rb index 93477e20..6683c30d 100644 --- a/test/integration/token_authenticatable_test.rb +++ b/test/integration/token_authenticatable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class TokenAuthenticationTest < ActionController::IntegrationTest diff --git a/test/integration/trackable_test.rb b/test/integration/trackable_test.rb index 8c245cc7..21b22bec 100644 --- a/test/integration/trackable_test.rb +++ b/test/integration/trackable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class TrackableHooksTest < ActionController::IntegrationTest diff --git a/test/mailers/confirmation_instructions_test.rb b/test/mailers/confirmation_instructions_test.rb index a32d402e..86008221 100644 --- a/test/mailers/confirmation_instructions_test.rb +++ b/test/mailers/confirmation_instructions_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class ConfirmationInstructionsTest < ActionMailer::TestCase diff --git a/test/mailers/reset_password_instructions_test.rb b/test/mailers/reset_password_instructions_test.rb index 46ebda16..5cd92c5e 100644 --- a/test/mailers/reset_password_instructions_test.rb +++ b/test/mailers/reset_password_instructions_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class ResetPasswordInstructionsTest < ActionMailer::TestCase diff --git a/test/mailers/unlock_instructions_test.rb b/test/mailers/unlock_instructions_test.rb index 8799bde3..013c0ec3 100644 --- a/test/mailers/unlock_instructions_test.rb +++ b/test/mailers/unlock_instructions_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class UnlockInstructionsTest < ActionMailer::TestCase diff --git a/test/mapping_test.rb b/test/mapping_test.rb index 6fe62e99..5d1cf746 100644 --- a/test/mapping_test.rb +++ b/test/mapping_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class MappingTest < ActiveSupport::TestCase diff --git a/test/models/authenticatable_test.rb b/test/models/authenticatable_test.rb index 96711f47..650c9b68 100644 --- a/test/models/authenticatable_test.rb +++ b/test/models/authenticatable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' require 'digest/sha1' class AuthenticatableTest < ActiveSupport::TestCase diff --git a/test/models/confirmable_test.rb b/test/models/confirmable_test.rb index eea24f0c..5632d1fa 100644 --- a/test/models/confirmable_test.rb +++ b/test/models/confirmable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class ConfirmableTest < ActiveSupport::TestCase diff --git a/test/models/http_authenticatable_test.rb b/test/models/http_authenticatable_test.rb index 948fcafb..24dd072f 100644 --- a/test/models/http_authenticatable_test.rb +++ b/test/models/http_authenticatable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class HttpAuthenticatableTest < ActiveSupport::TestCase test 'should authenticate a valid user with email and password and return it' do diff --git a/test/models/lockable_test.rb b/test/models/lockable_test.rb index a32e83dc..a95f708d 100644 --- a/test/models/lockable_test.rb +++ b/test/models/lockable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class LockableTest < ActiveSupport::TestCase diff --git a/test/models/recoverable_test.rb b/test/models/recoverable_test.rb index 42646d1b..ec0c5d69 100644 --- a/test/models/recoverable_test.rb +++ b/test/models/recoverable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class RecoverableTest < ActiveSupport::TestCase diff --git a/test/models/rememberable_test.rb b/test/models/rememberable_test.rb index 902d92e4..18f47acd 100644 --- a/test/models/rememberable_test.rb +++ b/test/models/rememberable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class RememberableTest < ActiveSupport::TestCase test 'should respond to remember_me attribute' do diff --git a/test/models/timeoutable_test.rb b/test/models/timeoutable_test.rb index 4e922127..12aad5e1 100644 --- a/test/models/timeoutable_test.rb +++ b/test/models/timeoutable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class TimeoutableTest < ActiveSupport::TestCase diff --git a/test/models/token_authenticatable_test.rb b/test/models/token_authenticatable_test.rb index 2c8d75b7..ac00a849 100644 --- a/test/models/token_authenticatable_test.rb +++ b/test/models/token_authenticatable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class TokenAuthenticatableTest < ActiveSupport::TestCase diff --git a/test/models/trackable_test.rb b/test/models/trackable_test.rb index 5406b440..a55ea69c 100644 --- a/test/models/trackable_test.rb +++ b/test/models/trackable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class TrackableTest < ActiveSupport::TestCase diff --git a/test/models/validatable_test.rb b/test/models/validatable_test.rb index 53f334fa..39e66b25 100644 --- a/test/models/validatable_test.rb +++ b/test/models/validatable_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class ValidatableTest < ActiveSupport::TestCase extend Devise::TestSilencer if [:mongo_mapper, :data_mapper].include?(DEVISE_ORM) diff --git a/test/models_test.rb b/test/models_test.rb index b9585bb7..d2857690 100644 --- a/test/models_test.rb +++ b/test/models_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class Configurable < User devise :authenticatable, :confirmable, :rememberable, :timeoutable, :lockable, diff --git a/test/routes_test.rb b/test/routes_test.rb index 2fdc862e..776e60b3 100644 --- a/test/routes_test.rb +++ b/test/routes_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class MapRoutingTest < ActionController::TestCase diff --git a/test/test_helpers_test.rb b/test/test_helpers_test.rb index 533c1f3d..c3898fe6 100644 --- a/test/test_helpers_test.rb +++ b/test/test_helpers_test.rb @@ -1,4 +1,4 @@ -require 'test/test_helper' +require 'test_helper' class TestHelpersTest < ActionController::TestCase tests UsersController