2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-04-13 12:47:28 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe 'Snippet', :js do
|
2020-07-31 08:10:02 -04:00
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
let_it_be(:snippet) { create(:personal_snippet, :public, :repository, author: user) }
|
2017-04-13 12:47:28 -04:00
|
|
|
|
2020-07-31 08:10:02 -04:00
|
|
|
it_behaves_like 'show and render proper snippet blob' do
|
|
|
|
let(:anchor) { nil }
|
2017-04-13 12:47:28 -04:00
|
|
|
|
2020-07-31 08:10:02 -04:00
|
|
|
subject do
|
|
|
|
visit snippet_path(snippet, anchor: anchor)
|
2017-04-13 12:47:28 -04:00
|
|
|
|
2017-05-17 14:25:13 -04:00
|
|
|
wait_for_requests
|
2017-04-13 12:47:28 -04:00
|
|
|
end
|
|
|
|
end
|
2018-07-16 12:18:52 -04:00
|
|
|
|
2020-10-08 08:08:31 -04:00
|
|
|
# it_behaves_like 'showing user status' do
|
|
|
|
# This will be handled in https://gitlab.com/gitlab-org/gitlab/-/issues/262394
|
2019-11-29 16:06:13 -05:00
|
|
|
|
2020-07-31 08:10:02 -04:00
|
|
|
it_behaves_like 'does not show New Snippet button' do
|
|
|
|
let(:file_path) { 'files/ruby/popen.rb' }
|
2019-11-29 16:06:13 -05:00
|
|
|
|
2020-07-31 08:10:02 -04:00
|
|
|
subject { visit snippet_path(snippet) }
|
2019-11-29 16:06:13 -05:00
|
|
|
end
|
2017-04-13 12:47:28 -04:00
|
|
|
end
|