Sha256: 6aa2edebbdff21ddf3b6f79aad36af772329f36dd5e9d071502ad39d624c55d9

Contents?: true

Size: 607 Bytes

Versions: 1

Compression:

Stored size: 607 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

1 entries across 1 versions & 1 rubygems

Version Path
nifty-generators-0.4.1 lib/generators/nifty/authentication/templates/tests/testunit/users_controller.rb