Viewing another products listing page does not display home page content

This commit is contained in:
Rohan Mitchell
2012-10-12 09:39:49 +11:00
parent 3dd3d8030f
commit 927970d1a9
3 changed files with 18 additions and 1 deletions

View File

@@ -1,2 +1,7 @@
module ApplicationHelper
def home_page_cms_content
if controller.controller_name == 'home' && controller.action_name == 'index'
cms_page_content(:content, Cms::Page.find_by_full_path('/'))
end
end
end

View File

@@ -1,4 +1,4 @@
= cms_page_content(:content, Cms::Page.find_by_full_path('/'))
= home_page_cms_content
- if @products
#products= render 'spree/shared/products', :products => @products, :taxon => @taxon

View File

@@ -20,6 +20,18 @@ feature %q{
page.should have_content 'Home page content'
end
scenario "viewing another products listing page does not display home page content" do
# Given a CMS home page
create(:cms_page, content: 'Home page content')
# When I visit a products listing page
visit spree.products_path
# Then I should not see the home page content
page.should_not have_content 'Home page content'
end
scenario "viewing the menu of CMS pages" do
# Given some CMS pages
home_page = create(:cms_page, content: 'Home')