Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add test case to ensure page part is deleted when page is destroyed

  • Loading branch information...
commit f603c1a068a13d66414898ef2658c83f71e4554b 1 parent 3d6b3f1
@primerano primerano authored
View
4 vendor/refinerycms/pages/features/manage_pages.feature
@@ -39,7 +39,9 @@ Feature: Manage Pages
And I should have a page at /about--2
Scenario: Delete Page
- Given I have a page titled "test"
+ Given I only have a page titled "test"
When I go to the list of pages
And I follow "Remove this page forever"
Then I should see "'test' was successfully destroyed."
+ And I should have 0 pages
+ And I should have 0 page_parts
View
11 vendor/refinerycms/pages/features/step_definitions/page_steps.rb
@@ -16,8 +16,11 @@
Page.delete_all
end
-Given /^I have a page titled "([^"]*)"$/ do |title|
- Page.create(:title => title)
+Given /^I (only )?have a page titled "([^"]*)"$/ do |only, title|
+ Page.delete_all if only
+ page = Page.create(:title => title)
+ page.parts << PagePart.new(:title => 'testing', :position => 0)
+ page
end
Then /^I should have ([0-9]+) pages?$/ do |count|
@@ -27,3 +30,7 @@
Then /^I should have a page at \/(.+)$/ do |url|
Page.all.count{|page| page.url[:path].to_s.include?(url)}.should == 1
end
+
+Then /^I should have (\d+) page_parts$/ do |count|
+ PagePart.count.should == count.to_i
+end
Please sign in to comment.
Something went wrong with that request. Please try again.