Patch #33117 » 33117.patch
| app/controllers/users_controller.rb (作業コピー) | ||
|---|---|---|
|
attrs = {:generate_password => @user.generate_password }
|
||
|
redirect_to new_user_path(:user => attrs)
|
||
|
else
|
||
|
redirect_to edit_user_path(@user)
|
||
|
redirect_to users_path
|
||
|
end
|
||
|
}
|
||
|
format.api { render :action => 'show', :status => :created, :location => user_url(@user) }
|
||
| test/functional/users_controller_test.rb (作業コピー) | ||
|---|---|---|
|
end
|
||
|
user = User.order('id DESC').first
|
||
|
assert_redirected_to :controller => 'users', :action => 'edit', :id => user.id
|
||
|
assert_redirected_to :controller => 'users', :action => 'index'
|
||
|
assert_equal 'John', user.firstname
|
||
|
assert_equal 'Doe', user.lastname
|
||