2016-11-03 02:34:52 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2017-06-29 00:13:10 -04:00
|
|
|
feature 'Public Snippets', :js 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
|