debian-mirror-gitlab/spec/features/snippets/internal_snippet_spec.rb

27 lines
599 B
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2019-12-04 20:38:33 +05:30
require 'spec_helper'
2017-08-17 22:00:37 +05:30
2020-06-23 00:09:42 +05:30
RSpec.describe 'Internal Snippets', :js do
2021-01-03 14:25:43 +05:30
let(:internal_snippet) { create(:personal_snippet, :internal, :repository) }
let(:content) { internal_snippet.blobs.first.data.strip! }
2020-01-01 13:55:28 +05:30
2017-08-17 22:00:37 +05:30
describe 'normal user' do
before do
2017-09-10 17:25:29 +05:30
sign_in(create(:user))
2017-08-17 22:00:37 +05:30
end
2018-11-08 19:23:39 +05:30
it 'sees internal snippets' do
2017-08-17 22:00:37 +05:30
visit snippet_path(internal_snippet)
2021-01-03 14:25:43 +05:30
expect(page).to have_content(content)
2017-08-17 22:00:37 +05:30
end
2018-11-08 19:23:39 +05:30
it 'sees raw internal snippets' do
2017-08-17 22:00:37 +05:30
visit raw_snippet_path(internal_snippet)
2021-01-03 14:25:43 +05:30
expect(page).to have_content(content)
2017-08-17 22:00:37 +05:30
end
end
end