summaryrefslogtreecommitdiff
path: root/users/test
diff options
context:
space:
mode:
Diffstat (limited to 'users/test')
-rw-r--r--users/test/functional/users_controller_test.rb4
-rw-r--r--users/test/unit/user_test.rb8
2 files changed, 7 insertions, 5 deletions
diff --git a/users/test/functional/users_controller_test.rb b/users/test/functional/users_controller_test.rb
index 4318928..e39869f 100644
--- a/users/test/functional/users_controller_test.rb
+++ b/users/test/functional/users_controller_test.rb
@@ -32,6 +32,7 @@ class UsersControllerTest < ActionController::TestCase
test "should get edit view" do
user = stub_record User
+ User.expects(:find_by_param).with(user.id.to_s).returns(user)
login user
get :edit, :id => user.id
assert_equal user, assigns[:user]
@@ -39,7 +40,8 @@ class UsersControllerTest < ActionController::TestCase
test "should process updated params" do
user = stub_record User
- user.expects(:update).with(user.params).returns(user)
+ user.expects(:update_attributes).with(user.params).returns(true)
+ User.expects(:find_by_param).with(user.id.to_s).returns(user)
login user
post :update, :user => user.params, :id => user.id
assert_equal user, assigns[:user]
diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb
index f057ca7..92c1463 100644
--- a/users/test/unit/user_test.rb
+++ b/users/test/unit/user_test.rb
@@ -23,14 +23,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