[rspec-users] [Newbie's Doubt] Model's Tests
julian at leviston.net
Wed Apr 18 01:30:50 UTC 2012
oh you mean a check for uniqueness.
Is this rails? If it is, pretty sure you can do this:
item = Item.create(:abbreviation => "ab")
duplicate_item = Item.create(:abbreviation => "ab")
item = Item.new(:abbreviation => "ab")
duplicate_item = Item.new(:abbreviation => "ab")
On 18/04/2012, at 11:11 AM, Luciano Borges wrote:
> 2012/4/17 Julian Leviston <julian at leviston.net>
> What do you mean repeated? You mean you can't have an abbreviation with two of the same letters?
> Hi Julian,
> Yes. I cat't have the same abbreviation on the table, I know that I have to put the validation in the model, but, I'd like to test first before change my model.
> rspec-users mailing list
> rspec-users at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users