2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2016-11-03 02:34:52 -04:00
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Public Snippets', :js do
|
|
|
|
it 'Unauthenticated user should see public snippets' do
|
2016-11-03 02:34:52 -04:00
|
|
|
public_snippet = create(:personal_snippet, :public)
|
|
|
|
|
|
|
|
visit snippet_path(public_snippet)
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2016-11-03 02:34:52 -04:00
|
|
|
|
|
|
|
expect(page).to have_content(public_snippet.content)
|
2019-10-14 11:06:07 -04:00
|
|
|
expect(page).to have_css('.js-embed-btn', visible: false)
|
|
|
|
expect(page).to have_css('.js-share-btn', visible: false)
|
2016-11-03 02:34:52 -04:00
|
|
|
end
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
it 'Unauthenticated user should see raw public snippets' do
|
2016-11-03 02:34:52 -04:00
|
|
|
public_snippet = create(:personal_snippet, :public)
|
|
|
|
|
|
|
|
visit raw_snippet_path(public_snippet)
|
|
|
|
|
|
|
|
expect(page).to have_content(public_snippet.content)
|
|
|
|
end
|
|
|
|
end
|