def test_update_action post :update , :id => 1, :contact => {:email => 'update@example.com'} contact1 = Contact.find(1) assert_equal 'update@example.com', contact1.email assert_redirected_to 'contacts/show/1' end