Sha256: 51d458404abf67f0f137678826ffae878e51c44e53ae0e86fc84f0b284c0dbd0

Contents?: true

Size: 565 Bytes

Versions: 23

Compression:

Stored size: 565 Bytes

Contents

require 'test_helper'

class <%= user_plural_class_name %>ControllerTest < ActionController::TestCase
  def test_new
    get :new
    assert_template 'new'
  end
  
  def test_create_invalid
    <%= user_class_name %>.any_instance.stubs(:valid?).returns(false)
    post :create
    assert_template 'new'
  end
  
  def test_create_valid
    <%= user_class_name %>.any_instance.stubs(:valid?).returns(true)
    post :create
    assert_redirected_to root_url
    assert_equal assigns['<%= user_singular_name %>'].id, session['<%= user_singular_name %>_id']
  end
end

Version data entries

23 entries across 23 versions & 6 rubygems

Version Path
iain-pizza-generators-0.1.1 rails_generators/pizza_authentication/templates/tests/testunit/users_controller.rb
iain-pizza-generators-0.1.2 rails_generators/pizza_authentication/templates/tests/testunit/users_controller.rb
intinno-nifty-generators-0.2.5 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
polly-nifty-generators-0.2.3 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
rubycs-nifty-generators-compass-0.0.1 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.2.5 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.2.6 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.2.7 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.2.8 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.2.9 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.3.0 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.3.1 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.3.2 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.3.3 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.3.4 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.3.5 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.3.6 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.3.7 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
twilson63-nifty-generators-0.3.8 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
nifty-generators-0.2.2 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb