I am using Ruby on Rails 3.0.9 and RSpec 2. I would like to know how I can\should run test for the following validation mathod:
class User < ActiveRecord::Base
validates :firstname, :unless => :condition,
:presence => true,
...
end
I mean the :unless => :condition part.
By creating objects that meet or don’t meet the condition and seeing if they’re valid/invalid.