Nilesh,

using:
     assert_equal :published, words(:one).status
     delete :destroy, :id => words(:one).to_param
     word_status = Word.find(:id).status
     assert_equal :deleted, word_status
still returns // ActiveRecord::RecordNotFound: Couldn't find Word with
ID=id

Fred,
I see what you mean now. If I wanted to pull the information from the
db instead of the fixture then there was no point in taking the time
to reload the stale fixture. Now that we've reloaded it I can feel
free to test against then fresh data.
This function now passes without problem and it makes sense:
  def test_should_delete_word
    assert_equal :published, words(:one).status
    delete :destroy, :id => words(:one).to_param
    words(:one).reload
    assert_equal :deleted, words(:one).status
  end

Again thanks everyone for your input !

On Sep 3, 1:50 am, Nilesh Kulkarni <[email protected]>
wrote:
> >   def test_should_delete_word
> >     assert_equal :published, words(:one).status
> >     delete :destroy, :id => words(:one).to_param
> >    reload!
> >     word_status = Word.find(:id).status
> >     assert_equal :deleted, word_status
> >   end
> > Again returns: MethodError: undefined method `reload!' for
> > #<WordsControllerTest:0x2858368>
>
> removereload!
>
>      assert_equal :published, words(:one).status
>      delete :destroy, :id => words(:one).to_param
>      word_status = Word.find(:id).status
>      assert_equal :deleted, word_status
>
> nilk_cse
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to