Sha256: 3c0207cf52931806371a6a27a75a748dbc65a06d1fb6c62d3e442d4c32042311

Contents?: true

Size: 612 Bytes

Versions: 13

Compression:

Stored size: 612 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
  <%- unless options[:authlogic] -%>
    assert_equal assigns['<%= user_singular_name %>'].id, session['<%= user_singular_name %>_id']
  <%- end -%>
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
flockonus-nifty-generators-0.0.12 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
nifty-generators-0.4.6 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
flockonus-nifty-generators-0.0.11 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
flockonus-nifty-generators-0.0.10 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
flockonus-nifty-generators-0.0.9 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
nifty-generators-0.4.5 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
flockonus-nifty-generators-0.0.8 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
flockonus-nifty-generators-0.0.7 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
flockonus-nifty-generators-0.0.6 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
nifty-generators-0.4.4 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
nifty-generators-0.4.3 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
nifty-generators-0.4.2 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb
nifty-generators-0.4.1 rails_generators/nifty_authentication/templates/tests/testunit/users_controller.rb