diff options
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/layouts/header/_new_dropdown.haml_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/views/layouts/header/_new_dropdown.haml_spec.rb b/spec/views/layouts/header/_new_dropdown.haml_spec.rb index 26e429ac5d0..1a04ffed103 100644 --- a/spec/views/layouts/header/_new_dropdown.haml_spec.rb +++ b/spec/views/layouts/header/_new_dropdown.haml_spec.rb @@ -126,6 +126,16 @@ describe 'layouts/header/_new_dropdown' do expect(rendered).to have_link('New snippet', href: new_snippet_path) end + + context 'when the user is not allowed to create snippets' do + let(:user) { create(:user, :external)} + + it 'has no "New snippet" link' do + render + + expect(rendered).not_to have_link('New snippet', href: new_snippet_path) + end + end end def stub_current_user(current_user) |