diff --git a/app/overrides/add_cms_admin_tab.rb b/app/overrides/add_cms_admin_tab.rb new file mode 100644 index 0000000000..f2bb052bbb --- /dev/null +++ b/app/overrides/add_cms_admin_tab.rb @@ -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 => "
  • <%= link_to('CMS Admin', main_app.cms_admin_path) %>
  • ") diff --git a/app/views/layouts/_cms_nav_spree.html.haml b/app/views/layouts/_cms_nav_spree.html.haml new file mode 100644 index 0000000000..d0ab75eeaa --- /dev/null +++ b/app/views/layouts/_cms_nav_spree.html.haml @@ -0,0 +1 @@ +%li= link_to 'Spree Admin', spree.admin_path diff --git a/config/initializers/comfortable_mexican_sofa.rb b/config/initializers/comfortable_mexican_sofa.rb index d23cb733a2..436299a9e0 100644 --- a/config/initializers/comfortable_mexican_sofa.rb +++ b/config/initializers/comfortable_mexican_sofa.rb @@ -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') diff --git a/spec/requests/admin/cms_spec.rb b/spec/requests/admin/cms_spec.rb new file mode 100644 index 0000000000..f34a92434d --- /dev/null +++ b/spec/requests/admin/cms_spec.rb @@ -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