On 20 November 2010 14:49, Neil Bye <[email protected]> wrote:
> Michael Pavling wrote in post #962781:
>> On 20 November 2010 13:47, Neil Bye <[email protected]> wrote:
>>> 1.It should show an error if an attempt is made to create a story
>>> without a story entry.
>>> 2.This is from annnettes_controller.rb
>>
>> But you're testing a Model... so the controller code is not very
>> useful to help with what's going on :-/
>
> There is no code in models/annette.rb
>
> I would be happy if any test worked

If you just want a test that works then change your existing test to
one that checks that you _can_ create an object if you _do_ provide a
story, use new instead of create and change the assert to assert_nil,
something like

class AnnnetteTest < ActiveSupport::TestCase
 def test_should_be_valid_with_story
a = Annnette.new(:story => 'Neil')
assert_nil a.errors.on(:story)
end

Colin

-- 
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