From 04421b355eb93de2888f12801cc0ebe123414264 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 11 Oct 2012 17:02:15 +0200 Subject: authenticate returns the user, to_json includes M2. bumped version to 0.1.3 This way the controller can easily use @user = @session.authenticate; respond_with @sessoin; --- test/session_test.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/session_test.rb b/test/session_test.rb index 9d1b92f..8327a63 100644 --- a/test/session_test.rb +++ b/test/session_test.rb @@ -1,4 +1,5 @@ require File.expand_path(File.dirname(__FILE__) + '/test_helper') +require 'json' class SessionTest < Test::Unit::TestCase @@ -21,7 +22,8 @@ class SessionTest < Test::Unit::TestCase session = SRP::Session.new(self, aa) session.send(:initialize_server, aa, b) # seeding b to compare to py_srp assert_equal bb.to_s(16), session.bb.to_s(16) - assert_equal m2, session.authenticate(m) + assert_equal self, session.authenticate(m) + assert_equal({'M2' => m2.to_s(16)}.to_json, session.to_json) end def test_zero_padded_salt -- cgit v1.2.3