On Fri, Jan 16, 2009 at 8:51 AM, Wegener Ken <kgwco...@yahoo.com> wrote:
> Solved my problem  all the examples I could find had the following example
> myTest.should_not_be_valid
> but that method wasn't a valid method.
>
> It appears the method has been refactored and the new form is
> mytest.should_not(be_valid)  which does work
>
> following test does what I want
> it "should not create a new instance given incompatible attribute values" do
>
> @invalid_attributes1 = {
>    :field1 = "value for field1"
>    :field2 = "value for field2"
>   }
>
> mytest = MyTest.create(@invalid_attributes)
> mytest.should_not(be_valid)
> end

Correct.  You can also write
mytest.should_not be_valid

which is a bit prettier :)

Pat
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to