Sha256: 44b07aa9b6106b371cd09cee43fc79b62878960c039b1bd3e10ca07ee5ec9b15

Contents?: true

Size: 480 Bytes

Versions: 72

Compression:

Stored size: 480 Bytes

Contents

  context "update action" do
    should "render edit template when model is invalid" do
      <%= class_name %>.any_instance.stubs(:valid?).returns(false)
      put :update, :id => <%= class_name %>.first
      assert_template 'edit'
    end
  
    should "redirect when model is valid" do
      <%= class_name %>.any_instance.stubs(:valid?).returns(true)
      put :update, :id => <%= class_name %>.first
      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/update.rb
iain-pizza-generators-0.1.2 rails_generators/pizza_scaffold/templates/tests/shoulda/actions/update.rb
iain-pizza-generators-0.1.3 rails_generators/pizza_scaffold/templates/tests/shoulda/actions/update.rb
iain-pizza-generators-0.1.4 rails_generators/pizza_scaffold/templates/tests/shoulda/actions/update.rb
intinno-nifty-generators-0.2.5 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
polly-nifty-generators-0.2.3 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
rubycs-nifty-generators-compass-0.0.1 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
ryanb-nifty-generators-0.1.7 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.2.5 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.2.6 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.2.7 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.2.8 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.2.9 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.3.0 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.3.1 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.3.2 rails_generators/nifty_nested_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.3.2 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.3.3 rails_generators/nifty_nested_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.3.3 rails_generators/nifty_scaffold/templates/tests/shoulda/actions/update.rb
twilson63-nifty-generators-0.3.4 rails_generators/nifty_nested_scaffold/templates/tests/shoulda/actions/update.rb