diff options
| author | Vlatka Pavisic | 2017-01-18 11:05:51 +0100 |
|---|---|---|
| committer | Vlatka Pavisic | 2017-01-18 11:05:51 +0100 |
| commit | 242455e1b6191453f7af98cd29390651ab871e51 (patch) | |
| tree | 0e75e9c3e1c629c819dbab91ae0f6acd4a859c1a /spec/support/devise.rb | |
| parent | 307f808e2c812bccccd1c6246ca6b8583be4ef40 (diff) | |
| download | chouette-core-242455e1b6191453f7af98cd29390651ab871e51.tar.bz2 | |
Refs #2426 : JourneyPattern User permissions
Diffstat (limited to 'spec/support/devise.rb')
| -rw-r--r-- | spec/support/devise.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/support/devise.rb b/spec/support/devise.rb index ae166d284..7cfa17f44 100644 --- a/spec/support/devise.rb +++ b/spec/support/devise.rb @@ -3,7 +3,8 @@ module DeviseRequestHelper def login_user organisation = Organisation.where(:code => "first").first_or_create(attributes_for(:organisation)) - @user ||= create(:user, :organisation => organisation, :permissions => ['routes.create', 'routes.edit', 'routes.destroy']) + @user ||= create(:user, :organisation => organisation, + :permissions => ['routes.create', 'routes.edit', 'routes.destroy', 'journey_patterns.create', 'journey_patterns.edit', 'journey_patterns.destroy']) login_as @user, :scope => :user # post_via_redirect user_session_path, 'user[email]' => @user.email, 'user[password]' => @user.password end @@ -34,7 +35,8 @@ module DeviseControllerHelper before(:each) do @request.env["devise.mapping"] = Devise.mappings[:user] organisation = Organisation.where(:code => "first").first_or_create(attributes_for(:organisation)) - user = create(:user, :organisation => organisation, :permissions => ['routes.create', 'routes.edit', 'routes.destroy']) + user = create(:user, :organisation => organisation, + :permissions => ['routes.create', 'routes.edit', 'routes.destroy', 'journey_patterns.create', 'journey_patterns.edit', 'journey_patterns.destroy']) sign_in user end end |
