2019-10-14 11:06:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe 'Private Snippets', :js do
|
2019-10-14 11:06:07 -04:00
|
|
|
let(:user) { create(:user) }
|
2020-10-08 08:08:31 -04:00
|
|
|
let(:private_snippet) { create(:personal_snippet, :repository, :private, author: user) }
|
|
|
|
let(:content) { private_snippet.blobs.first.data.strip! }
|
2019-10-14 11:06:07 -04:00
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
|
|
|
end
|
|
|
|
|
2020-12-09 13:09:48 -05:00
|
|
|
it 'private Snippet renders for creator' do
|
2019-10-14 11:06:07 -04:00
|
|
|
visit snippet_path(private_snippet)
|
|
|
|
wait_for_requests
|
|
|
|
|
2020-10-08 08:08:31 -04:00
|
|
|
expect(page).to have_content(content)
|
2019-10-14 11:06:07 -04:00
|
|
|
expect(page).not_to have_css('.js-embed-btn')
|
|
|
|
expect(page).not_to have_css('.js-share-btn')
|
|
|
|
end
|
|
|
|
end
|