Browse files

Merge pull request #386 from shifthealthparadigms/rails4-remove-depre…

…cation-pass-tests

Rails4 remove deprecation pass tests
  • Loading branch information...
2 parents 4ac79c0 + 7466506 commit cd49b427f62aa60df077aff320d0e01656f466c3 @binarylogic committed Feb 28, 2014
View
3 .gitignore
@@ -7,4 +7,5 @@ coverage/*
doc/*
benchmarks/*
.specification
-.rvmrc
+.rvmrc
+gemfiles/*.gemfile.lock
View
2 lib/authlogic/acts_as_authentic/persistence_token.rb
@@ -36,7 +36,7 @@ def forget_all
records = nil
i = 0
begin
- records = find(:all, :limit => 50, :offset => i)
+ records = limit(50).offset(i)
records.each { |record| record.forget! }
i += 50
end while !records.blank?
View
2 lib/authlogic/authenticates_many/base.rb
@@ -42,7 +42,7 @@ def authenticates_many(name, options = {})
options[:relationship_name] ||= options[:session_class].klass_name.underscore.pluralize
class_eval <<-"end_eval", __FILE__, __LINE__
def #{name}
- find_options = #{options[:find_options].inspect} || #{options[:relationship_name]}.scoped
+ find_options = #{options[:find_options].inspect} || #{options[:relationship_name]}.where(nil)
@#{name} ||= Authlogic::AuthenticatesMany::Association.new(#{options[:session_class]}, find_options, #{options[:scope_cookies] ? "self.class.model_name.underscore + '_' + self.send(self.class.primary_key).to_s" : "nil"})
end
end_eval
View
1 lib/authlogic/test_case.rb
@@ -117,4 +117,5 @@ def controller
end
::Test::Unit::TestCase.send(:include, TestCase) if defined?(::Test::Unit::TestCase)
+ ::MiniTest::Unit::TestCase.send(:include, TestCase) if defined?(::MiniTest::Unit::TestCase)
end
View
15 test/acts_as_authentic_test/password_test.rb
@@ -111,16 +111,25 @@ def test_validates_length_of_password
u.password = "test"
assert !u.valid?
- assert u.errors[:password_confirmation].size == 0
+
+ if ActiveModel.respond_to?(:version) and ActiveModel.version.segments.first >= 4
+ assert u.errors[:password_confirmation].size == 5
+ else
+ assert u.errors[:password_confirmation].size == 0
+ end
end
def test_validates_confirmation_of_password
u = User.new
u.password = "test"
u.password_confirmation = "test2"
assert !u.valid?
- assert u.errors[:password].size > 0
-
+# assert u.errors[:password].size > 0
+ if ActiveModel.respond_to?(:version) and ActiveModel.version.segments.first >= 4
+ assert u.errors[:password_confirmation].size > 0
+ else
+ assert u.errors[:password].size > 0
+ end
u.password_confirmation = "test"
assert !u.valid?
assert u.errors[:password].size == 0
View
2 test/test_helper.rb
@@ -5,6 +5,7 @@
require "timecop"
require "i18n"
+
I18n.load_path << File.dirname(__FILE__) + '/i18n/lol.yml'
#ActiveRecord::Schema.verbose = false
@@ -14,6 +15,7 @@
ActiveRecord::Base.logger = logger
ActiveRecord::Base.configurations = true
+ActiveRecord::Base.default_timezone = :local
ActiveRecord::Schema.define(:version => 1) do
create_table :companies do |t|
t.datetime :created_at

0 comments on commit cd49b42

Please sign in to comment.