2019-07-25 01:24:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-09-23 13:28:14 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-03 14:08:28 -04:00
|
|
|
RSpec.describe 'Snippets' do
|
2016-09-23 13:28:14 -04:00
|
|
|
context 'when the project has snippets' do
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { create(:project, :public) }
|
2016-09-23 13:28:14 -04:00
|
|
|
let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) }
|
2019-12-05 22:08:02 -05:00
|
|
|
|
2016-09-23 13:28:14 -04:00
|
|
|
before do
|
|
|
|
allow(Snippet).to receive(:default_per_page).and_return(1)
|
2019-12-05 22:08:02 -05:00
|
|
|
|
|
|
|
visit project_snippets_path(project)
|
2016-09-23 13:28:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'paginated snippets'
|
|
|
|
end
|
2019-12-05 22:08:02 -05:00
|
|
|
|
|
|
|
describe 'rendering engine' do
|
|
|
|
let_it_be(:snippet) { create(:personal_snippet, :public) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
visit snippet_path(snippet)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'renders Vue application' do
|
|
|
|
expect(page).to have_selector('#js-snippet-view')
|
|
|
|
expect(page).not_to have_selector('.personal-snippets')
|
|
|
|
end
|
|
|
|
end
|
2016-09-23 13:28:14 -04:00
|
|
|
end
|