summaryrefslogtreecommitdiff
path: root/lib/generators/nifty/scaffold/templates/tests/testunit/actions/update.rb
blob: b588bfcb8e72661bc10cb3caa83c4975c71dc9de (plain)
1
2
3
4
5
6
7
8
9
10
11
  def test_update_invalid
    <%= class_name %>.any_instance.stubs(:valid?).returns(false)
    put :update, :id => <%= class_name %>.first
    assert_template 'edit'
  end

  def test_update_valid
    <%= class_name %>.any_instance.stubs(:valid?).returns(true)
    put :update, :id => <%= class_name %>.first
    assert_redirected_to <%= item_path_for_test('url') %>
  end