Revision fa9836c1
Added by Lucas Tolchinsky over 14 years ago
- ID fa9836c13647c1e35bba92a39a4e78b0a94ba38b
test/functional/users_controller_test.rb | ||
---|---|---|
require 'test_helper'
|
||
|
||
class UsersControllerTest < ActionController::TestCase
|
||
# Replace this with your real tests.
|
||
|
||
test "should get index" do
|
||
get :index
|
||
assert_response :success
|
||
... | ... | |
get :edit, :id => u.id
|
||
#assert_response :success
|
||
end
|
||
|
||
|
||
test "should update user" do
|
||
user = User.create :login => "foo", :mail => "foo@bar.com"
|
||
|
||
|
||
put :update, { :commit => "Update", :id => user.id, :record => {:login => "johnsmith"} }
|
||
mod_user = User.find_by_id(user.id)
|
||
|
||
|
||
assert mod_user.login == "johnsmith"
|
||
assert_redirected_to users_path
|
||
end
|
||
|
||
|
||
test "should get show" do
|
||
test "should get show" do
|
||
u = User.create :login => "foo", :mail => "foo@bar.com"
|
||
get :show, :id => u.id
|
||
assert_not_nil assigns("record")
|
||
assert_response :success
|
||
end
|
||
|
||
|
||
|
||
test "should delete" do
|
||
u = User.create :login => "foo", :mail => "foo@bar.com"
|
||
assert_difference('User.count', -1) do
|
Also available in: Unified diff
removed trailing spaces from hosts and users controller test