Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (28 sloc) 0.953 kb
require File.dirname(__FILE__) + '/test_helper.rb'
class SessionTest < ActiveSupport::TestCase
def test_openid_identifier
session = UserSession.new
assert session.respond_to?(:openid_identifier)
session.openid_identifier = "test"
assert_equal "http://test/", session.openid_identifier
end
def test_validate_openid_error
session = UserSession.new
session.openid_identifier = "yes"
session.openid_identifier = "%"
assert_nil session.openid_identifier
assert !session.save
assert session.errors.on(:openid_identifier)
end
def test_validate_by_nil_openid_identifier
session = UserSession.new
assert !session.save
assert !redirecting_to_yahoo?
end
def test_validate_by_correct_openid_identifier
session = UserSession.new
session.openid_identifier = "https://me.yahoo.com/a/9W0FJjRj0o981TMSs0vqVxPdmMUVOQ--"
assert !session.save
assert redirecting_to_yahoo?
end
end
Jump to Line
Something went wrong with that request. Please try again.