private_snippets_spec.rb 553 Bytes
Newer Older
1
2
3
4
5
6
7
8
# frozen_string_literal: true

require 'spec_helper'

describe 'Private Snippets', :js do
  let(:user) { create(:user) }

  before do
9
    stub_feature_flags(snippets_vue: false)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
    sign_in(user)
  end

  it 'Private Snippet renders for creator' do
    private_snippet = create(:personal_snippet, :private, author: user)

    visit snippet_path(private_snippet)
    wait_for_requests

    expect(page).to have_content(private_snippet.content)
    expect(page).not_to have_css('.js-embed-btn')
    expect(page).not_to have_css('.js-share-btn')
  end
end