Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

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

#5

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

Reported by Nicholas Rutherford · October 29th, 2009 @ 08:14 PM

State: new
Milestone: none
Assigned to: nobody

Activity

  1. Ian White
    Ian White
    • 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

    November 22nd, 2009 @ 09:56 AM

  2. Ian White
    Ian White

    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

    November 22nd, 2009 @ 09:57 AM

  3. Nicholas Rutherford
    Nicholas Rutherford
    • Assigned user cleared.
    • Milestone order changed from 0 to 0

    September 13th, 2011 @ 09:43 PM

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.