Skip to content

Commit

Permalink
Make generated pickle steps less picky about possessives, so pickle m…
Browse files Browse the repository at this point in the history
…apping can work in more situations
  • Loading branch information
ianwhite committed Nov 24, 2009
1 parent a6e1927 commit 14977d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rails_generators/pickle/templates/pickle_steps.rb
Expand Up @@ -11,7 +11,7 @@
end

# create models from a table
Given /^the following #{capture_plural_factory} exist$/ do |plural_factory, table|
Given /^the following #{capture_plural_factory} exist:?$/ do |plural_factory, table|
name = plural_factory.singularize
table.hashes.each { |hash| create_model(name, hash) }
end
Expand All @@ -32,22 +32,22 @@
end

# assert model is in another model's has_many assoc
Then(/^#{capture_model} should be (?:in|one of|amongst) #{capture_model}'s (\w+)$/) do |target, owner, association|
Then(/^#{capture_model} should be (?:in|one of|amongst) #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association|
model(owner).send(association).should include(model(target))
end

# assert model is not in another model's has_many assoc
Then(/^#{capture_model} should not be (?:in|one of|amongst) #{capture_model}'s (\w+)$/) do |target, owner, association|
Then(/^#{capture_model} should not be (?:in|one of|amongst) #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association|
model(owner).send(association).should_not include(model(target))
end

# assert model is another model's has_one/belongs_to assoc
Then(/^#{capture_model} should be #{capture_model}'s (\w+)$/) do |target, owner, association|
Then(/^#{capture_model} should be #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association|
model(owner).send(association).should == model(target)
end

# assert model is not another model's has_one/belongs_to assoc
Then(/^#{capture_model} should not be #{capture_model}'s (\w+)$/) do |target, owner, association|
Then(/^#{capture_model} should not be #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association|
model(owner).send(association).should_not == model(target)
end

Expand Down

0 comments on commit 14977d7

Please sign in to comment.