OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/spec/lib/permission_spec.rb

33 lines
980 B

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
require 'redmine/access_control'
describe Redmine::AccessControl::Permission do
describe "WHEN setting global permission" do
describe "creating with", :new do
before {@permission = Redmine::AccessControl::Permission.new(:perm, {:cont => [:action]}, {:global => true})}
describe :global? do
it {@permission.global?.should be_true}
end
end
end
describe "setting non_global" do
describe "creating with", :new do
before {@permission = Redmine::AccessControl::Permission.new :perm, {:cont => [:action]}, {:global => false}}
describe :global? do
it {@permission.global?.should be_false}
end
end
describe "creating with", :new do
before {@permission = Redmine::AccessControl::Permission.new :perm, {:cont => [:action]}, {}}
describe :global? do
it {@permission.global?.should be_false}
end
end
end
end