Sha256: 1ef72006729625392be141dedd60bb0c829b96d973a7a8f8e22812562ba604c1
Contents?: true
Size: 1.14 KB
Versions: 13
Compression:
Stored size: 1.14 KB
Contents
require File.join(File.dirname(__FILE__), '..', '/test_helper') module Garb class SessionTest < Test::Unit::TestCase context "The Session class" do should "be able retrieve an auth_token for a user" do auth_request = mock {|m| m.expects(:auth_token).with({}).returns('toke') } AuthenticationRequest.expects(:new).with('email', 'password').returns(auth_request) Session.login('email', 'password') assert_equal 'toke', Session.auth_token end should "be able retrieve an auth_token for a user with secure ssl" do auth_request = mock {|m| m.expects(:auth_token).with({:secure => true}).returns('toke') } AuthenticationRequest.expects(:new).with('email', 'password').returns(auth_request) Session.login('email', 'password', :secure => true) assert_equal 'toke', Session.auth_token end should "retain the email address for this session" do AuthenticationRequest.stubs(:new).returns(stub(:auth_token => 'toke')) Session.login('email', 'password') assert_equal 'email', Session.email end end end end
Version data entries
13 entries across 13 versions & 4 rubygems