mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Create links between Spree and CMS admin sections
This commit is contained in:
4
app/overrides/add_cms_admin_tab.rb
Normal file
4
app/overrides/add_cms_admin_tab.rb
Normal 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>")
|
||||
1
app/views/layouts/_cms_nav_spree.html.haml
Normal file
1
app/views/layouts/_cms_nav_spree.html.haml
Normal file
@@ -0,0 +1 @@
|
||||
%li= link_to 'Spree Admin', spree.admin_path
|
||||
@@ -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')
|
||||
|
||||
21
spec/requests/admin/cms_spec.rb
Normal file
21
spec/requests/admin/cms_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user