#5 new
Nicholas Rutherford

Add ability for pickle models to be referenced without using factory name

Reported by Nicholas Rutherford | 2009-10-29 20:14:30 UTC

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

    Ian White 2009-11-22 09:56:21 UTC

    • 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

    Ian White 2009-11-22 09:57:48 UTC

    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

    Nicholas Rutherford 2011-09-13 21:43:00 UTC

    • 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.

New ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Assign tickets to Ian White, so I get notified

People watching this ticket

Pages