Sha256: 8323efb6ecfbbd57b7b7bf53f272669ab1602440556b1ed659cd9f169bb4f86d

Contents?: true

Size: 472 Bytes

Versions: 5

Compression:

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

5 entries across 5 versions & 1 rubygems

Version Path
zoo-generators-0.1.5 lib/generators/zoo/scaffold/templates/tests/shoulda/actions/update.rb
zoo-generators-0.1.4 lib/generators/zoo/scaffold/templates/tests/shoulda/actions/update.rb
zoo-generators-0.1.3 lib/generators/zoo/scaffold/templates/tests/shoulda/actions/update.rb
zoo-generators-0.1.2 lib/generators/zoo/scaffold/templates/tests/shoulda/actions/update.rb
zoo-generators-0.1.1 lib/generators/zoo/scaffold/templates/tests/shoulda/actions/update.rb