Add ability for pickle models to be referenced without using factory name
Reported by Nicholas Rutherford | October 29th, 2009 @ 08:14 PM
find a model
Then(/^#{capture_model} should exist(?: with #{capture_fields})?$/) do |name, fields|
find_model(name, fields).should_not be_nil
end
# find exactly n models
Then(/^(\d+) #{capture_plural_factory} should exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields|
find_models(plural_factory.singularize, fields).size.should == count.to_i
end
make it so this can handle
And 1 service should exist
can just add (?:\d+)? to the start of the singular model assert?
instead of
And 1 services should exist
Comments and changes to this ticket
-
Ian White November 22nd, 2009 @ 09:56 AM
- Title changed from improving singular model assert to say e.g. "Then 1 service should exist" to Add ability for pickle models to be referenced without using factory name
-
Ian White November 22nd, 2009 @ 09:57 AM
For this to work, We'll need a different quoting style, otherwise strings will match.
How about:
Given a user [Fred] exists And a project exists with manager: [Fred]
This should be able to be added without breaking bc
-
Nicholas Rutherford September 13th, 2011 @ 09:43 PM
- Assigned user cleared.
- Milestone order changed from 0 to 0
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Assign tickets to <b>Ian White</b>, so I get notified