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

3
require 'spec_helper'
4

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

8
9
10
11
  before do
    stub_feature_flags(snippets_vue: false)
  end

12
13
  describe 'normal user' do
    before do
14
      sign_in(create(:user))
15
16
    end

17
    it 'sees internal snippets' do
18
19
20
21
22
      visit snippet_path(internal_snippet)

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

23
    it 'sees raw internal snippets' do
24
25
26
27
28
29
      visit raw_snippet_path(internal_snippet)

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