aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/controller_spec_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/support/controller_spec_helper.rb b/spec/support/controller_spec_helper.rb
index 1d0288dea..dbc7d582b 100644
--- a/spec/support/controller_spec_helper.rb
+++ b/spec/support/controller_spec_helper.rb
@@ -11,6 +11,21 @@ module ControllerSpecHelper
end
end
+ def with_feature feature, &block
+ context "with feature #{feature}" do
+ login_user
+ before(:each) do
+ organisation = @user.organisation
+ unless organisation.has_feature?(feature)
+ organisation.features << feature
+ organisation.save!
+ end
+ sign_in @user
+ end
+ context('', &block) if block_given?
+ end
+ end
+
end
RSpec.configure do |config|