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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/snippets_spec.rb')
-rw-r--r--spec/features/snippets_spec.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/spec/features/snippets_spec.rb b/spec/features/snippets_spec.rb
index 9df6fe7d16b..bc7fa161e87 100644
--- a/spec/features/snippets_spec.rb
+++ b/spec/features/snippets_spec.rb
@@ -6,11 +6,38 @@ describe 'Snippets' do
context 'when the project has snippets' do
let(:project) { create(:project, :public) }
let!(:snippets) { create_list(:project_snippet, 2, :public, author: project.owner, project: project) }
+
before do
allow(Snippet).to receive(:default_per_page).and_return(1)
- visit snippets_path(username: project.owner.username)
+
+ visit project_snippets_path(project)
end
it_behaves_like 'paginated snippets'
end
+
+ describe 'rendering engine' do
+ let_it_be(:snippet) { create(:personal_snippet, :public) }
+ let(:snippets_vue_feature_flag_enabled) { true }
+
+ before do
+ stub_feature_flags(snippets_vue: snippets_vue_feature_flag_enabled)
+
+ 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
+
+ context 'when feature flag is disabled' do
+ let(:snippets_vue_feature_flag_enabled) { false }
+
+ it 'renders HAML application and not Vue' do
+ expect(page).not_to have_selector('#js-snippet-view')
+ expect(page).to have_selector('.personal-snippets')
+ end
+ end
+ end
end