Sha256: 9053f7563cd398daea34c1fbf2fa8b5731a02f9639168164d334f03c37abc8e2

Contents?: true

Size: 754 Bytes

Versions: 19

Compression:

Stored size: 754 Bytes

Contents

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

module ORMAdaptersTests
  module ActiveRecordAdapterTests
    module ActsAsAuthenticTests
      class LoggedInTest < ActiveSupport::TestCase
        def test_named_scopes
          assert_equal 0, User.logged_in.count
          assert_equal User.count, User.logged_out.count
          http_basic_auth_for(users(:ben)) { UserSession.find }
          assert_equal 1, User.logged_in.count
          assert_equal User.count - 1, User.logged_out.count
        end
        
        def test_logged_in
          ben = users(:ben)
          assert !ben.logged_in?
          assert ben.update_attribute(:last_request_at, Time.now)
          assert ben.logged_in?
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
authlogic-1.3.1 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.2.0 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.1.2 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.3.2 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.1.1 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.3.0 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.2.1 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.2.2 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.4.0 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.3.5 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.3.6 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.3.7 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.3.9 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.4.1 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.3.4 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.3.8 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.3.3 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.4.3 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb
authlogic-1.4.2 test/orm_adapters_tests/active_record_adapter_tests/acts_as_authentic_tests/logged_in_test.rb