2016-11-03 02:34:52 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-04-13 12:47:28 -04:00
|
|
|
feature 'Public Snippets', :js, feature: true do
|
2016-11-03 02:34:52 -04:00
|
|
|
scenario 'Unauthenticated user should see public snippets' do
|
|
|
|
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)
|
|
|
|
end
|
|
|
|
|
|
|
|
scenario 'Unauthenticated user should see raw public snippets' do
|
|
|
|
public_snippet = create(:personal_snippet, :public)
|
|
|
|
|
|
|
|
visit raw_snippet_path(public_snippet)
|
|
|
|
|
|
|
|
expect(page).to have_content(public_snippet.content)
|
|
|
|
end
|
|
|
|
end
|