mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
Remove CMS specs
This commit is contained in:
@@ -1 +0,0 @@
|
||||
label: Default Fixture Layout
|
||||
@@ -1,5 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
{{ cms:page:content }}
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
body{color: red}
|
||||
@@ -1 +0,0 @@
|
||||
// default js
|
||||
@@ -1,2 +0,0 @@
|
||||
label: Default Fixture Nested Layout
|
||||
position: 42
|
||||
@@ -1,2 +0,0 @@
|
||||
<div class='left'> {{ cms:page:left }} </div>
|
||||
<div class='right'> {{ cms:page:right }} </div>
|
||||
@@ -1 +0,0 @@
|
||||
div{float:left}
|
||||
@@ -1 +0,0 @@
|
||||
// nested js
|
||||
@@ -1,2 +0,0 @@
|
||||
label: Home Fixture Page
|
||||
layout: default
|
||||
@@ -1,3 +0,0 @@
|
||||
label: Child Fixture Page
|
||||
layout: nested
|
||||
position: 42
|
||||
@@ -1 +0,0 @@
|
||||
Child Page Left Fixture Content
|
||||
@@ -1 +0,0 @@
|
||||
Child Page Right Fixture Content
|
||||
@@ -1,2 +0,0 @@
|
||||
Home Page Fixture Contént
|
||||
{{ cms:snippet:default }}
|
||||
@@ -1 +0,0 @@
|
||||
label: Default Fixture Snippet
|
||||
@@ -1 +0,0 @@
|
||||
Fixture Content for Default Snippet
|
||||
@@ -383,39 +383,3 @@ FactoryGirl.modify do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# -- CMS
|
||||
FactoryGirl.define do
|
||||
factory :cms_site, :class => Cms::Site do
|
||||
identifier 'open-food-network'
|
||||
label 'Open Food Network'
|
||||
hostname 'localhost'
|
||||
end
|
||||
|
||||
factory :cms_layout, :class => Cms::Layout do
|
||||
site { Cms::Site.first || create(:cms_site) }
|
||||
label 'layout'
|
||||
identifier 'layout'
|
||||
content '{{ cms:page:content:text }}'
|
||||
end
|
||||
|
||||
factory :cms_page, :class => Cms::Page do
|
||||
site { Cms::Site.first || create(:cms_site) }
|
||||
label 'page'
|
||||
sequence(:slug) { |n| "page-#{n}" }
|
||||
layout { Cms::Layout.first || create(:cms_layout) }
|
||||
|
||||
# Pass content through to block, where it is stored
|
||||
after(:create) do |cms_page, evaluator|
|
||||
cms_page.blocks.first.update_attribute(:content, evaluator.content)
|
||||
cms_page.save! # set_cached_content
|
||||
end
|
||||
end
|
||||
|
||||
factory :cms_block, :class => Cms::Block do
|
||||
page { Cms::Page.first || create(:cms_page) }
|
||||
identifier 'block'
|
||||
content 'hello, block'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
feature %q{
|
||||
In order to provide content to users of the site
|
||||
As an administrator
|
||||
I want to access the CMS admin site
|
||||
} do
|
||||
include AuthenticationWorkflow
|
||||
include WebHelper
|
||||
|
||||
scenario "admin can access CMS admin and return to Spree admin" do
|
||||
login_to_admin_section
|
||||
click_link 'Configuration'
|
||||
click_link 'CMS Admin'
|
||||
page.should have_content "ComfortableMexicanSofa"
|
||||
|
||||
click_link 'Spree Admin'
|
||||
expect(page).to have_current_path /^\/admin/
|
||||
end
|
||||
|
||||
scenario "anonymous user can't access CMS admin", js: true do
|
||||
visit cms_admin_path
|
||||
page.should_not have_content "ComfortableMexicanSofa"
|
||||
page.should have_content "Login"
|
||||
end
|
||||
|
||||
scenario "non-admin user can't access CMS admin", js: true do
|
||||
login_to_consumer_section
|
||||
page.should_not have_content "Login"
|
||||
visit cms_admin_path
|
||||
page.should_not have_content "ComfortableMexicanSofa"
|
||||
expect(page).to have_current_path root_path
|
||||
end
|
||||
end
|
||||
@@ -1,68 +0,0 @@
|
||||
require 'spec_helper'
|
||||
|
||||
feature %q{
|
||||
In order to learn about food
|
||||
As a user of the site
|
||||
I want to see static content pages
|
||||
}, skip: true do
|
||||
include AuthenticationWorkflow
|
||||
include WebHelper
|
||||
let(:d) { create(:distributor_enterprise, :name => 'Edible garden') }
|
||||
|
||||
background do
|
||||
create_enterprise_group_for d
|
||||
end
|
||||
|
||||
scenario "viewing shop front does not display home page content" do
|
||||
# Given a CMS home page
|
||||
create(:cms_page, content: 'Home page content')
|
||||
|
||||
# When I visit the home page
|
||||
visit spree.root_path
|
||||
|
||||
# and proceed to the shop front
|
||||
click_on 'Edible garden'
|
||||
visit enterprise_path d
|
||||
|
||||
# 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')
|
||||
create(:cms_page, parent: home_page, label: 'One')
|
||||
create(:cms_page, parent: home_page, label: 'Two')
|
||||
create(:cms_page, parent: home_page, label: 'Three')
|
||||
|
||||
# When I visit the home page
|
||||
visit spree.root_path
|
||||
# and proceed to the shop front
|
||||
click_on "Edible garden"
|
||||
visit enterprise_path d
|
||||
|
||||
|
||||
# Then I should see a menu with these pages
|
||||
page.should have_selector 'ul#main-nav-bar li', :text => 'One'
|
||||
page.should have_selector 'ul#main-nav-bar li', :text => 'Two'
|
||||
page.should have_selector 'ul#main-nav-bar li', :text => 'Three'
|
||||
end
|
||||
|
||||
scenario "viewing a page from the CMS menu" do
|
||||
# Given some CMS pages
|
||||
home_page = create(:cms_page, content: 'Home')
|
||||
create(:cms_page, parent: home_page, label: 'One')
|
||||
create(:cms_page, parent: home_page, label: 'Two', content: 'This is the page')
|
||||
create(:cms_page, parent: home_page, label: 'Three')
|
||||
|
||||
# When I go to one of the pages
|
||||
visit spree.root_path
|
||||
click_on "Edible garden"
|
||||
visit enterprise_path d
|
||||
click_link 'Two'
|
||||
|
||||
# Then I should see the page
|
||||
page.should have_content 'This is the page'
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user