internal_snippet_spec.rb 554 Bytes
Newer Older
1
2
# frozen_string_literal: true

3
4
require 'rails_helper'

5
describe 'Internal Snippets', :js do
6
7
8
9
  let(:internal_snippet) { create(:personal_snippet, :internal) }

  describe 'normal user' do
    before do
10
      sign_in(create(:user))
11
12
    end

13
    it 'sees internal snippets' do
14
15
16
17
18
      visit snippet_path(internal_snippet)

      expect(page).to have_content(internal_snippet.content)
    end

19
    it 'sees raw internal snippets' do
20
21
22
23
24
25
      visit raw_snippet_path(internal_snippet)

      expect(page).to have_content(internal_snippet.content)
    end
  end
end