Tidy up cucumbers a tad.
This commit is contained in:
parent
ad0adc7153
commit
4d9c77d41a
@ -3,9 +3,6 @@ Feature: Has Many Association
|
|||||||
In order to make dealing with models easier
|
In order to make dealing with models easier
|
||||||
I want to be able to display other models that have a has many association
|
I want to be able to display other models that have a has many association
|
||||||
|
|
||||||
Background:
|
|
||||||
Given I have the site: "test site" set up
|
|
||||||
|
|
||||||
Scenario: Paginating a has many association
|
Scenario: Paginating a has many association
|
||||||
Given I have an "Articles" model which has many "Comments"
|
Given I have a site set up
|
||||||
Then I should be able to view a paginated list of "Comments" per "Articles"
|
Then I should be able to view a paginaed list of a has many association
|
||||||
|
@ -17,7 +17,10 @@ Given %r{^I have an? "([^"]*)" model which has many "([^"]*)"$} do |parent_model
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should be able to view a paginated list of "([^"]*)" per "([^"]*)"$/ do |parent_model, child_model|
|
Then /^I should be able to view a paginaed list of a has many association$/ do
|
||||||
|
# Create models
|
||||||
|
Given %{I have an "Articles" model which has many "Comments"}
|
||||||
|
|
||||||
# Create contents
|
# Create contents
|
||||||
article = @parent_model.contents.create!(:slug => 'parent', :body => 'Parent')
|
article = @parent_model.contents.create!(:slug => 'parent', :body => 'Parent')
|
||||||
@child_model.contents.create!(:slug => 'one', :body => 'One', :custom_field_2 => article.id.to_s)
|
@child_model.contents.create!(:slug => 'one', :body => 'One', :custom_field_2 => article.id.to_s)
|
||||||
|
Loading…
Reference in New Issue
Block a user