diff options
| author | Zog | 2017-12-18 17:18:25 +0100 | 
|---|---|---|
| committer | Zog | 2017-12-19 14:21:52 +0100 | 
| commit | 98c08c6fae5b0bf59231b3e402ca91307c200297 (patch) | |
| tree | 51dc7a30198d6fa83df13948fc2223effb01cc28 /spec/support | |
| parent | 3aa5ff0d1f5e74b4c46c14e6240e7def82f0451d (diff) | |
| download | chouette-core-98c08c6fae5b0bf59231b3e402ca91307c200297.tar.bz2 | |
Refs #5333@1.5h; Use permissions to sync StopAreas and Lines
- add missing policies
- update permissions translator
- update views to check for the permission
- update views helper to check for the permission
- uipdate controllers to check for the permission
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/controller_spec_helper.rb | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/spec/support/controller_spec_helper.rb b/spec/support/controller_spec_helper.rb new file mode 100644 index 000000000..1d0288dea --- /dev/null +++ b/spec/support/controller_spec_helper.rb @@ -0,0 +1,18 @@ +module ControllerSpecHelper +  def with_permission permission, &block +    context "with permission #{permission}" do +      login_user +      before(:each) do +        @user.permissions << permission +        @user.save! +        sign_in @user +      end +      context('', &block) if block_given? +    end +  end + +end + +RSpec.configure do |config| +  config.extend ControllerSpecHelper, type: :controller +end | 
