Sha256: d7c76a25868ef41d4ee29f0d0102fc33af646f22fc017364b95652c4fdbcd94f

Contents?: true

Size: 785 Bytes

Versions: 19

Compression:

Stored size: 785 Bytes

Contents

require 'test_helper'

class <%= user_plural_class_name %>ControllerTest < ActionController::TestCase
  context "new action" do
    should "render new template" do
      get :new
      assert_template 'new'
    end
  end
  
  context "create action" do
    should "render new template when model is invalid" do
      <%= user_class_name %>.any_instance.stubs(:valid?).returns(false)
      post :create
      assert_template 'new'
    end
  
    should "redirect when model is valid" do
      <%= 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
end

Version data entries

19 entries across 19 versions & 9 rubygems

Version Path
corntrace-nifty-generators-0.4.1 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
corntrace-nifty-generators-0.4.0 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
nifty-generators-0.4.0 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
splendeo-generators-0.3.1 rails_generators/splendeo_authentication/templates/tests/shoulda/users_controller.rb
splendeo-generators-0.3.0 rails_generators/splendeo_authentication/templates/tests/shoulda/users_controller.rb
splendeo-generators-0.2.1 rails_generators/splendeo_authentication/templates/tests/shoulda/users_controller.rb
splendeo-generators-0.2.0 rails_generators/splendeo_authentication/templates/tests/shoulda/users_controller.rb
splendeo-generators-0.1.3 rails_generators/splendeo_authentication/templates/tests/shoulda/users_controller.rb
splendeo-generators-0.1.2 rails_generators/splendeo_authentication/templates/tests/shoulda/users_controller.rb
splendeo-generators-0.1.1 rails_generators/splendeo_authentication/templates/tests/shoulda/users_controller.rb
splendeo-generators-0.1.0 rails_generators/splendeo_authentication/templates/tests/shoulda/users_controller.rb
splendeo-nifty-generators-0.3.2 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
nifty-generators-0.3.2 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
linki-nifty-generators-0.3.1 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
linki-nifty_generators-0.3.1 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
minerva-nifty-generators-0.3.0 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
xenda-nifty-generators-0.3.2 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
ghart-nifty-generators-0.3.0.1 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb
nifty-generators-0.3.0 rails_generators/nifty_authentication/templates/tests/shoulda/users_controller.rb