2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2017-04-25 10:41:26 -04:00
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe 'Internal Snippets', :js do
|
2020-10-08 08:08:31 -04:00
|
|
|
let(:internal_snippet) { create(:personal_snippet, :internal, :repository) }
|
|
|
|
let(:content) { internal_snippet.blobs.first.data.strip! }
|
2019-12-05 22:08:02 -05:00
|
|
|
|
2017-04-25 10:41:26 -04:00
|
|
|
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)
|
|
|
|
|
2020-10-08 08:08:31 -04:00
|
|
|
expect(page).to have_content(content)
|
2017-04-25 10:41:26 -04:00
|
|
|
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)
|
|
|
|
|
2020-10-08 08:08:31 -04:00
|
|
|
expect(page).to have_content(content)
|
2017-04-25 10:41:26 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|