2017-04-25 10:41:26 -04:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
describe 'Internal Snippets', :js do
|
2017-04-25 10:41:26 -04:00
|
|
|
let(:internal_snippet) { create(:personal_snippet, :internal) }
|
|
|
|
|
|
|
|
describe 'normal user' do
|
|
|
|
before do
|
2017-06-21 19:44:10 -04:00
|
|
|
sign_in(create(:user))
|
2017-04-25 10:41:26 -04:00
|
|
|
end
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
it 'sees internal snippets' do
|
2017-04-25 10:41:26 -04:00
|
|
|
visit snippet_path(internal_snippet)
|
|
|
|
|
|
|
|
expect(page).to have_content(internal_snippet.content)
|
|
|
|
end
|
|
|
|
|
2018-07-05 02:32:05 -04:00
|
|
|
it 'sees raw internal snippets' do
|
2017-04-25 10:41:26 -04:00
|
|
|
visit raw_snippet_path(internal_snippet)
|
|
|
|
|
|
|
|
expect(page).to have_content(internal_snippet.content)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|