Files
growstuff/spec/features/cms_spec.rb
Brenda Wallace 34b399cd8e Use more signed in contexts in browse crops spec
More member role contexts on alt name spec

More member role contexts in crop feature specs

Don't wrap the shared_context
2019-08-18 16:10:03 +12:00

26 lines
771 B
Ruby

require 'rails_helper'
describe "cms admin" do
it "can't view CMS admin if not signed in" do
visit comfy_admin_cms_path
expect(current_path).to eq root_path
expect(page).to have_content "Please sign in as an admin user"
end
context 'signed in' do
include_context 'signed in member'
it "can't view CMS admin if not an admin member" do
visit comfy_admin_cms_path
expect(current_path).to eq root_path
expect(page).to have_content "Please sign in as an admin user"
end
end
context 'admin' do
include_context 'signed in admin'
it "admin members can view CMS admin area" do
visit comfy_admin_cms_path
expect(current_path).to match(/#{comfy_admin_cms_path}/) # match any CMS admin page
end
end
end