Sha256: 0fc24d2d565dc1c7291c2657d36bf88d8612e55121d4547d29e027746e1c58a4

Contents?: true

Size: 634 Bytes

Versions: 9

Compression:

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
flexi_generators-0.2.10 lib/generators/flexi/auth/templates/tests/testunit/users_controller.rb
flexi_generators-0.2.8 lib/generators/flexi_auth/templates/tests/testunit/users_controller.rb
flexi_generators-0.2.6 lib/generators/flexi_auth/templates/tests/testunit/users_controller.rb
flexi_generators-0.2.5 lib/generators/flexi_auth/templates/tests/testunit/users_controller.rb
flexi_generators-0.2.4 lib/generators/flexi_auth/templates/tests/testunit/users_controller.rb
flexi_generators-0.2.3 lib/generators/flexi_auth/templates/tests/testunit/users_controller.rb
flexi_generators-0.2.2 lib/generators/flexi_auth/templates/tests/testunit/users_controller.rb
flexi_generators-0.2.1 lib/generators/flexi_auth/templates/tests/testunit/users_controller.rb
flexi_generators-0.2.0 lib/generators/flexi_auth/templates/tests/testunit/users_controller.rb