summaryrefslogtreecommitdiff
path: root/users/test/unit
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2012-11-26 10:15:22 -0800
committerjessib <jessib@leap.se>2012-11-26 10:15:22 -0800
commit3e744e4e226eae3ea2f900d9fccc32b6c046d65f (patch)
tree1b19232d08229b178c094c92e2242ce1686099ae /users/test/unit
parentd9d67bd60d3fdfa4106977de9e5aba11f659fc79 (diff)
parentbf74255d1530fe5852dc6e6c27ef975ce9aa8d3c (diff)
Merge branch 'develop' into help_develop
Conflicts: users/app/views/sessions/_nav.html.haml
Diffstat (limited to 'users/test/unit')
-rw-r--r--users/test/unit/user_test.rb9
-rw-r--r--users/test/unit/warden_strategy_secure_remote_password_test.rb4
2 files changed, 7 insertions, 6 deletions
diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb
index 9977fca..2269d4e 100644
--- a/users/test/unit/user_test.rb
+++ b/users/test/unit/user_test.rb
@@ -5,6 +5,7 @@ class UserTest < ActiveSupport::TestCase
include SRP::Util
setup do
@attribs = User.valid_attributes_hash
+ User.find_by_login(@attribs[:login]).try(:destroy)
@user = User.new(@attribs)
end
@@ -23,14 +24,14 @@ class UserTest < ActiveSupport::TestCase
assert !@user.valid?
end
- test "find_by_param gets User by login" do
+ test "find_by_param gets User by id" do
@user.save
- assert_equal @user, User.find_by_param(@user.login)
+ assert_equal @user, User.find_by_param(@user.id)
@user.destroy
end
- test "to_param gives user login" do
- assert_equal @user.login, @user.to_param
+ test "to_param gives user id" do
+ assert_equal @user.id, @user.to_param
end
test "verifier returns number for the hex in password_verifier" do
diff --git a/users/test/unit/warden_strategy_secure_remote_password_test.rb b/users/test/unit/warden_strategy_secure_remote_password_test.rb
index 79480f0..319809a 100644
--- a/users/test/unit/warden_strategy_secure_remote_password_test.rb
+++ b/users/test/unit/warden_strategy_secure_remote_password_test.rb
@@ -32,7 +32,7 @@ class WardenStrategySecureRemotePasswordTest < ActiveSupport::TestCase
User.expects(:find_by_param).with(unknown).raises(RECORD_NOT_FOUND)
post :create, :login => unknown
assert_response :success
- assert_json_response :errors => {"login" => ["unknown user"]}
+ assert_json_error "login" => ["unknown user"]
end
test "should authorize" do
@@ -56,7 +56,7 @@ class WardenStrategySecureRemotePasswordTest < ActiveSupport::TestCase
post :update, :id => @user.login, :client_auth => @client_hex
assert_nil session[:handshake]
assert_nil session[:user_id]
- assert_json_response :errors => {"password" => ["wrong password"]}
+ assert_json_error "password" => ["wrong password"]
end
=end