On 12 Jan., 04:05, Nick <n...@deadorange.com> wrote: > On Tuesday, January 11, 2011 6:23:07 AM UTC-5, Dennis Schmidt wrote: > > > # postcard_spec.rb > > require File.dirname(__FILE__) + '/../spec_helper' > > describe Postcard do > > it {should validate_presence_of(:text)} > > it "should validate presence of text" do > > p = Postcard.new > > p.save! > > p.errors.include?(:text).should be_true > > end > > end > > If you use the non-bang version of save, the spec passes. IE: > p.save > instead of > p.save!
It makes no difference, whether I use the bang or the non-bang version. Both ways it fails. Especially the shoulda spec one-line test should work, but doesn't. And as I said, the strangest thing of all is, that the test works as expected (passes) if I put it in any controller spec for instance (not the shoulda one, of course). So my code must be correct (since rails itself works as expected and the console works as expected) BUT only this very spec in that spec file doesn't work at all. And that's the thing, I have absolutely NO clue at all, what might be the reason for that. To me, it looks like a bug in some of the components I'm using or their interaction. But then, it is such a simple test, I can hardly believe a bug like this would slip through undetected. So yeah... any further suggestions? -- 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 rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.