Created
August 26, 2010 12:25
-
-
Save amuino/551303 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.dirname(__FILE__) + '/../test_helper' | |
require 'signup_controller' | |
# Re-raise errors caught by the controller. | |
class SignupController; def rescue_action(e) raise e end; end | |
# | |
# Adivinen pq falla el assert_not_nil current_user, cuando no debería :-) | |
# | |
class SignupControllerTest < ActionController::TestCase | |
def test_user_is_created_after_start | |
assert_difference "User.count" do | |
post :do_start, :user => { :login => "a_new_user", :password => "passwd", :password_confirmation => "passwd", | |
:email => "a_new_user@example.com", :gender_id => Gender.find_by_name("male").id.to_s } | |
assert_not_nil assigns(:user) | |
assert assigns(:user).errors.empty? | |
assert_response :redirect | |
assert_redirected_to :action => :profile | |
current_user = @controller.instance_exec { current_user } | |
assert_not_nil current_user | |
assert_equal current_user, assigns(:user) | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment