debian-mirror-gitlab/spec/features/snippets/show_spec.rb
2020-10-24 23:57:45 +05:30

35 lines
810 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Snippet', :js do
let_it_be(:user) { create(:user) }
let_it_be(:snippet) { create(:personal_snippet, :public, :repository, author: user) }
before do
stub_feature_flags(snippets_vue: false)
end
it_behaves_like 'show and render proper snippet blob' do
let(:anchor) { nil }
subject do
visit snippet_path(snippet, anchor: anchor)
wait_for_requests
end
end
it_behaves_like 'showing user status' do
let(:file_path) { 'files/ruby/popen.rb' }
let(:user_with_status) { snippet.author }
subject { visit snippet_path(snippet) }
end
it_behaves_like 'does not show New Snippet button' do
let(:file_path) { 'files/ruby/popen.rb' }
subject { visit snippet_path(snippet) }
end
end