diff options
| author | Vlatka Pavisic | 2017-01-23 14:48:46 +0100 | 
|---|---|---|
| committer | Vlatka Pavisic | 2017-01-23 14:48:46 +0100 | 
| commit | 39887727b818815f002d9fb6c28344e2b50ce209 (patch) | |
| tree | 35a318c9d4193f09db04c12ce8d6af581b6808c2 /spec/features/line_footnotes_spec.rb | |
| parent | ed75c7827615d0ae58202212189dbfbbf4b92609 (diff) | |
| download | chouette-core-39887727b818815f002d9fb6c28344e2b50ce209.tar.bz2 | |
Refs #2428 #2427 : User permissions
Diffstat (limited to 'spec/features/line_footnotes_spec.rb')
| -rw-r--r-- | spec/features/line_footnotes_spec.rb | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/spec/features/line_footnotes_spec.rb b/spec/features/line_footnotes_spec.rb index a3eab103a..1209e96b0 100644 --- a/spec/features/line_footnotes_spec.rb +++ b/spec/features/line_footnotes_spec.rb @@ -26,5 +26,19 @@ describe 'Line Footnotes', type: :feature do        expect(page).not_to have_content(I18n.t('actions.destroy'))        expect(page).not_to have_content(I18n.t('actions.add'))      end + +    context 'user has permission to edit footnotes' do +      it 'shows edit link for footnotes' do +        expect(page).to have_content(I18n.t('lines.actions.edit_footnotes')) +      end +    end + +    context 'user does not have permission to edit footnotes' do +      it 'does not show edit link for footnotes' do +        @user.update_attribute(:permissions, []) +        visit referential_line_footnotes_path(referential.line_referential, line) +        expect(page).not_to have_content(I18n.t('lines.actions.edit_footnotes')) +      end +    end    end  end | 
