Sha256: bc9bcec4440c2d4fc2e107adb4f02e42cd7ac7b0512a1712d1f58e71abee26c1

Contents?: true

Size: 418 Bytes

Versions: 72

Compression:

Stored size: 418 Bytes

Contents

  context "create action" do
    should "render new template when model is invalid" do
      <%= class_name %>.any_instance.stubs(:valid?).returns(false)
      post :create
      assert_template 'new'
    end
    
    should "redirect when model is valid" do
      <%= class_name %>.any_instance.stubs(:valid?).returns(true)
      post :create
      assert_redirected_to <%= item_path_for_test('url') %>
    end
  end

Version data entries

72 entries across 61 versions & 20 rubygems

Version Path
iain-pizza-generators-0.1.1 rails_generators/pizza_scaffold/templates/tests/shoulda/actions/create.rb
iain-pizza-generators-0.1.2 rails_generators/pizza_scaffold/templates/tests/shoulda/actions/create.rb
iain-pizza-generators-0.1.3 rails_generators/pizza_scaffold/templates/tests/shoulda/actions/create.rb
iain-pizza-generators-0.1.4 rails_generators/pizza_scaffold/templates/tests/shoulda/actions/create.rb
intinno-nifty-generators-0.2.5 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
polly-nifty-generators-0.2.3 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
rubycs-nifty-generators-compass-0.0.1 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
ryanb-nifty-generators-0.1.7 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.2.5 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.2.6 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.2.7 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.2.8 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.2.9 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.3.0 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.3.1 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.3.2 rails_generators/nifty_nested_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.3.2 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.3.3 rails_generators/nifty_nested_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.3.3 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/create.rb
twilson63-nifty-generators-0.3.4 rails_generators/nifty_nested_scaffold/templates/tests/shoulda/actions/create.rb