Sha256: ea2144df85eb3d117040d2699786a2b10d2266106ed12edef90b6f97d1f191c6
Contents?: true
Size: 1.25 KB
Versions: 21
Compression:
Stored size: 1.25 KB
Contents
require 'test_helper' class UsersControllerTest < ActionController::TestCase tests Headstart::UsersController should_filter_params :password context "when signed out" do setup { sign_out } context "on GET to #new" do setup { get :new } should_respond_with :success should_render_template :new should_not_set_the_flash should_display_a_sign_up_form end context "on GET to #new with email" do setup do @email = "a@example.com" get :new, :user => { :email => @email } end should "set assigned user's email" do assert_equal @email, assigns(:user).email end end context "on POST to #create with valid attributes" do setup do user_attributes = Factory.attributes_for(:user) post :create, :user => user_attributes end should_assign_to :user should_change 'User.count', :by => 1 should_redirect_to_url_after_create end end signed_in_user_context do context "GET to new" do setup { get :new } should_redirect_to("the home page") { root_url } end context "POST to create" do setup { post :create, :user => {} } should_redirect_to("the home page") { root_url } end end end
Version data entries
21 entries across 21 versions & 1 rubygems