Sha256: 5e3eee260d80debf27c862344975760d43fa2f7c5625ea68a67f0dafc49239dc

Contents?: true

Size: 815 Bytes

Versions: 4

Compression:

Stored size: 815 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper.rb'

module SessionTests
  class AuthenticatesManyAssociationTest < ActiveSupport::TestCase
    def test_initialize
      assoc = Authlogic::Session::AuthenticatesManyAssociation.new(UserSession, {:conditions => ["1 = ?", 1]}, :some_id)
      assert_equal UserSession, assoc.klass
      assert_equal({:conditions => ["1 = ?", 1]}, assoc.find_options)
      assert_equal :some_id, assoc.id
    end
    
    def test_new
      ben = users(:ben)
      assoc = Authlogic::Session::AuthenticatesManyAssociation.new(UserSession, {:conditions => ["1 = ?", 1]}, :some_id)
      session = assoc.new(ben)
      assert_equal ben, session.unauthorized_record
      assert_equal({:find_options => {:conditions => ["1 = ?", 1]}, :id => :some_id}, session.scope)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
authlogic-1.1.0 test/session_tests/authenticates_many_association_test.rb
authlogic-1.1.1 test/session_tests/authenticates_many_association_test.rb
authlogic-1.2.0 test/session_tests/authenticates_many_association_test.rb
authlogic-1.1.2 test/session_tests/authenticates_many_association_test.rb