Skip to content

Instantly share code, notes, and snippets.

@honorlin
Created October 24, 2014 07:40
Show Gist options
  • Save honorlin/b9655a68521c216fc4bb to your computer and use it in GitHub Desktop.
Save honorlin/b9655a68521c216fc4bb to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe "root have any permissions", :type => :request do
before do
post '/signin', :username => "root", :password => "root"
end
describe "it can access any page" do
it "can access /policy/policies" do
get "/policy/policies"
expect(response.body).to_not have_content "Access denied"
end
it "can access /agents" do
get "/agents"
expect(response.body).to_not have_content "Access denied"
end
it "can access /agents" do
get "/agents"
expect(response.body).to_not have_content "Access denied"
end
it "can access //quote/start/" do
get "/quote/start/"
expect(response.body).to_not have_content "Access denied"
end
it "can access /customers" do
get "/customers"
expect(response.body).to_not have_content "Access denied"
end
it "can access /tasks/dashboard" do
get "/tasks/dashboard"
expect(response.body).to_not have_content "Access denied"
end
it "can access /admin/resources" do
get "/admin/resources"
expect(response.body).to_not have_content "Access denied"
end
it "can access /claims" do
get "/claims"
expect(response.body).to_not have_content "Access denied"
end
it "can access /system/dashboard" do
get "/system/dashboard"
expect(response.body).to_not have_content "Access denied"
end
end
end
describe "with policies of Authorisations to ClientService_users of Role", :type => :request do
before do
RoleAuthorisationRelationship.create(:authorisation_id => 1, :role_id => 8)
post '/signin', :username => "Angela.Iserescu", :password => "Angela"
end
describe "Add policies of Authorisations to ClientService_users of Role" do
it "can access /policy/policies" do
get "/policy/policies"
expect(response.body).to_not have_content "Access denied"
end
it "can access /agents" do
get "/agents"
expect(response.body).to_not have_content "Access denied"
end
it "can access /agents" do
get "/agents"
expect(response.body).to_not have_content "Access denied"
end
it "can access //quote/start/" do
get "/quote/start/"
expect(response.body).to_not have_content "Access denied"
end
it "can access /customers" do
get "/customers"
expect(response.body).to_not have_content "Access denied"
end
it "can access /tasks/dashboard" do
get "/tasks/dashboard"
expect(response.body).to_not have_content "Access denied"
end
it "can access /admin/resources" do
get "/admin/resources"
expect(response.body).to_not have_content "Access denied"
end
it "can access /claims" do
get "/claims"
expect(response.body).to_not have_content "Access denied"
end
it "can access /system/dashboard" do
get "/system/dashboard"
expect(response.body).to_not have_content "Access denied"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment