aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support
diff options
context:
space:
mode:
authorZog2017-12-26 11:23:53 +0100
committerZog2017-12-26 11:23:53 +0100
commitd3445d085b607544dc6355956cd228835258d612 (patch)
tree62588979f26e42e1cbbffab91690256281008b1c /spec/support
parent9fe0ca13d7caba486561f52557c1fa3d2f9f0a52 (diff)
downloadchouette-core-d3445d085b607544dc6355956cd228835258d612.tar.bz2
Refs #5382 @1h; Enable all area types for Stopareas in Routes
Given that the organisation has the matching feature.
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|