aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/controller_spec_helper.rb12
-rw-r--r--spec/support/permissions.rb2
2 files changed, 13 insertions, 1 deletions
diff --git a/spec/support/controller_spec_helper.rb b/spec/support/controller_spec_helper.rb
index dbc7d582b..ac4bfe06c 100644
--- a/spec/support/controller_spec_helper.rb
+++ b/spec/support/controller_spec_helper.rb
@@ -11,6 +11,18 @@ module ControllerSpecHelper
end
end
+ def without_permission permission, &block
+ context "without permission #{permission}" do
+ login_user
+ before(:each) do
+ @user.permissions.delete permission
+ @user.save!
+ sign_in @user
+ end
+ context('', &block) if block_given?
+ end
+ end
+
def with_feature feature, &block
context "with feature #{feature}" do
login_user
diff --git a/spec/support/permissions.rb b/spec/support/permissions.rb
index 825e44725..557fb9a51 100644
--- a/spec/support/permissions.rb
+++ b/spec/support/permissions.rb
@@ -2,7 +2,7 @@ module Support
module Permissions extend self
def all_permissions
- @__all_permissions__ ||= _destructive_permissions << 'sessions.create'
+ @__all_permissions__ ||= _destructive_permissions + %w{sessions.create workbenches.update}
end
private