I am using Factory Girl to create two instances in my model/unit test for a Group. I am testing the model to check that a call to .current returns only the \'current\' groups ac
This isn't very specific to FactoryGirl, but you can always bypass validations when saving models via save(:validate => false)
:
describe ".current" do
let!(:current_group) { FactoryGirl.create(:group) }
let!(:old_group) {
g = FactoryGirl.build(:group, :expiry => Time.now - 3.days)
g.save(:validate => false)
g
}
specify { Group.current.should == [current_group] }
end