Welcome to mirror list, hosted at ThFree Co, Russian Federation.

public_snippets_spec.rb « snippets « features « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4b72b33245d0499c05e526aa34fa0db6a8714eb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'Public Snippets', :js do
  before do
    stub_feature_flags(snippets_vue: false)
  end

  it 'Unauthenticated user should see public snippets' do
    public_snippet = create(:personal_snippet, :public)

    visit snippet_path(public_snippet)
    wait_for_requests

    expect(page).to have_content(public_snippet.content)
    expect(page).to have_css('.js-embed-btn', visible: false)
    expect(page).to have_css('.js-share-btn', visible: false)
    expect(page.find('.js-snippet-url-area')).to be_readonly
  end

  it 'Unauthenticated user should see raw public snippets' do
    public_snippet = create(:personal_snippet, :public)

    visit raw_snippet_path(public_snippet)

    expect(page).to have_content(public_snippet.content)
  end
end