Create links between Spree and CMS admin sections

This commit is contained in:
Rohan Mitchell
2012-10-11 12:50:59 +11:00
parent e1d4ee318c
commit 28fc16ac66
4 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
Deface::Override.new(:virtual_path => "spree/layouts/admin",
:name => "cms_admin_tab",
:insert_bottom => "[data-hook='admin_tabs'], #admin_tabs[data-hook]",
:text => "<li><%= link_to('CMS Admin', main_app.cms_admin_path) %></li>")

View File

@@ -0,0 +1 @@
%li= link_to 'Spree Admin', spree.admin_path

View File

@@ -117,3 +117,4 @@ ComfortableMexicanSofa::HttpAuth.password = 'password'
# ComfortableMexicanSofa::ViewHooks.add(:navigation, '/layouts/admin/navigation')
# ComfortableMexicanSofa::ViewHooks.add(:html_head, '/layouts/admin/html_head')
# ComfortableMexicanSofa::ViewHooks.add(:page_form, '/layouts/admin/page_form')
ComfortableMexicanSofa::ViewHooks.add(:navigation, 'layouts/cms_nav_spree')

View File

@@ -0,0 +1,21 @@
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 'CMS Admin'
page.should have_content "ComfortableMexicanSofa"
click_link 'Spree Admin'
page.should have_selector 'h1', :text => 'Administration'
end
end