summaryrefslogtreecommitdiff
path: root/users/test/functional/users_controller_test.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-12-17 10:18:14 +0100
committerAzul <azul@leap.se>2012-12-17 10:18:14 +0100
commitfa21fe9a5ba10f937cd21e83aa26a088f58e2e8a (patch)
treedfa6b0e45805561978fb0cce8f6e4a0101a6018b /users/test/functional/users_controller_test.rb
parent30f953c06bbd71becfc59afb3fb49abaa853eacc (diff)
parent6b9ceba75230705a073cf7ba6439c07e29a57be3 (diff)
Merge branch 'feature/fix-tests-in-master'
Diffstat (limited to 'users/test/functional/users_controller_test.rb')
-rw-r--r--users/test/functional/users_controller_test.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/users/test/functional/users_controller_test.rb b/users/test/functional/users_controller_test.rb
index 1840a72..ce17500 100644
--- a/users/test/functional/users_controller_test.rb
+++ b/users/test/functional/users_controller_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class UsersControllerTest < ActionController::TestCase
- include StubRecordHelper
test "should get new" do
get :new
@@ -35,7 +34,10 @@ class UsersControllerTest < ActionController::TestCase
end
test "should get edit view" do
- user = find_record User, :email => nil, :email_forward => nil
+ user = find_record User,
+ :email => nil,
+ :email_forward => nil,
+ :email_aliases => []
login user
get :edit, :id => user.id
@@ -45,7 +47,9 @@ class UsersControllerTest < ActionController::TestCase
test "should process updated params" do
user = find_record User
- user.expects(:update_attributes).with(user.params).returns(true)
+ user.expects(:attributes=).with(user.params)
+ user.expects(:changed?).returns(true)
+ user.expects(:save).returns(true)
login user
put :update, :user => user.params, :id => user.id, :format => :json
@@ -57,7 +61,9 @@ class UsersControllerTest < ActionController::TestCase
test "admin can update user" do
user = find_record User
- user.expects(:update_attributes).with(user.params).returns(true)
+ user.expects(:attributes=).with(user.params)
+ user.expects(:changed?).returns(true)
+ user.expects(:save).returns(true)
login :is_admin? => true
put :update, :user => user.params, :id => user.id, :format => :json