PageRenderTime 21ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/spec/features/snippets/private_snippets_spec.rb

https://gitlab.com/tnir/gitlab-ce
Ruby | 23 lines | 16 code | 6 blank | 1 comment | 0 complexity | 53a3483d9a2d388733d069154bbefe6a MD5 | raw file
 1# frozen_string_literal: true
 2
 3require 'spec_helper'
 4
 5describe 'Private Snippets', :js do
 6  let(:user) { create(:user) }
 7
 8  before do
 9    stub_feature_flags(snippets_vue: false)
10    sign_in(user)
11  end
12
13  it 'Private Snippet renders for creator' do
14    private_snippet = create(:personal_snippet, :private, author: user)
15
16    visit snippet_path(private_snippet)
17    wait_for_requests
18
19    expect(page).to have_content(private_snippet.content)
20    expect(page).not_to have_css('.js-embed-btn')
21    expect(page).not_to have_css('.js-share-btn')
22  end
23end