diff options
| author | Zog | 2017-12-26 11:23:53 +0100 | 
|---|---|---|
| committer | Zog | 2017-12-26 11:23:53 +0100 | 
| commit | d3445d085b607544dc6355956cd228835258d612 (patch) | |
| tree | 62588979f26e42e1cbbffab91690256281008b1c /spec/support | |
| parent | 9fe0ca13d7caba486561f52557c1fa3d2f9f0a52 (diff) | |
| download | chouette-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.rb | 15 | 
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| | 
