From 69bdfe7a7fdb4dffda3d58becbc1c4c2c2ffff22 Mon Sep 17 00:00:00 2001 From: Vlatka Pavisic Date: Tue, 7 Mar 2017 16:01:00 +0100 Subject: Refs #2693 : Test permissions sync --- spec/models/user_spec.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'spec/models') diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index bbeb0caf5..f56680fc0 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -81,7 +81,7 @@ describe User, :type => :model do it 'should create new users' do User.portail_sync - expect(User.count).to eq(11) + expect(User.count).to eq(12) expect(Organisation.count).to eq(3) end @@ -112,7 +112,15 @@ describe User, :type => :model do it 'should not create new user if username is already present' do create :user, username: 'alban.peignier' User.portail_sync - expect(User.count).to eq(11) + expect(User.count).to eq(12) + end + + context 'permissions' do + it 'should give edit permissions to user if user has "edit offer" permission in portail' do + User.portail_sync + expect(User.find_by(username: 'vlatka.pavisic').permissions).not_to be_empty + expect(User.find_by(username: 'pierre.vabre').permissions).to be_nil + end end end -- cgit v1.2.3