mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Upgrade capybara, spec/requests changed to spec/features
This commit is contained in:
34
spec/features/admin/cms_spec.rb
Normal file
34
spec/features/admin/cms_spec.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
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
|
||||
|
||||
scenario "anonymous user can't access CMS admin" 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" do
|
||||
login_to_consumer_section
|
||||
visit cms_admin_path
|
||||
page.should_not have_content "ComfortableMexicanSofa"
|
||||
page.should have_content "Open Food Web"
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user