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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
620 B
Ruby
Raw Permalink Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
require 'spec_helper'
2023-03-04 22:38:38 +05:30
RSpec.describe 'Private Snippets', :js, feature_category: :source_code_management do
2019-12-21 20:55:43 +05:30
let(:user) { create(:user) }
2021-01-03 14:25:43 +05:30
let(:private_snippet) { create(:personal_snippet, :repository, :private, author: user) }
let(:content) { private_snippet.blobs.first.data.strip! }
2019-12-21 20:55:43 +05:30
before do
sign_in(user)
end
2021-02-22 17:27:13 +05:30
it 'private Snippet renders for creator' do
2019-12-21 20:55:43 +05:30
visit snippet_path(private_snippet)
wait_for_requests
2021-01-03 14:25:43 +05:30
expect(page).to have_content(content)
2019-12-21 20:55:43 +05:30
expect(page).not_to have_css('.js-embed-btn')
expect(page).not_to have_css('.js-share-btn')
end
end