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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-21 21:09:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-21 21:09:31 +0300
commitf1d9023a9049ed7defec5566063b7f704c26dfd6 (patch)
tree0e7ea3a1e0d07c4b69baf361e99bad4fc1e16bc9 /spec/features
parente33f87ac0fabaab468ce4b457996cc0f1b1bb648 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/groups/import_export/export_file_spec.rb59
-rw-r--r--spec/features/issues/spam_issues_spec.rb4
-rw-r--r--spec/features/snippets/spam_snippets_spec.rb10
3 files changed, 66 insertions, 7 deletions
diff --git a/spec/features/groups/import_export/export_file_spec.rb b/spec/features/groups/import_export/export_file_spec.rb
new file mode 100644
index 00000000000..5829e659722
--- /dev/null
+++ b/spec/features/groups/import_export/export_file_spec.rb
@@ -0,0 +1,59 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe 'Group Export', :js do
+ include ExportFileHelper
+
+ let_it_be(:user) { create(:user) }
+ let_it_be(:group) { create(:group) }
+
+ context 'when the signed in user has the required permission level' do
+ before do
+ group.add_owner(user)
+ sign_in(user)
+ end
+
+ it 'allows the user to export the group', :sidekiq_inline do
+ visit edit_group_path(group)
+
+ expect(page).to have_content('Export group')
+
+ click_link('Export group')
+ expect(page).to have_content('Group export started')
+
+ expect(page).to have_content('Download export')
+ end
+ end
+
+ context 'when the group import/export FF is disabled' do
+ before do
+ stub_feature_flags(group_import_export: false)
+
+ group.add_owner(user)
+ sign_in(user)
+ end
+
+ it 'does not show the group export options' do
+ visit edit_group_path(group)
+
+ expect(page).to have_content('Advanced')
+ expect(page).not_to have_content('Export group')
+ end
+ end
+
+ context 'when the signed in user does not have the required permission level' do
+ before do
+ group.add_guest(user)
+
+ sign_in(user)
+ end
+
+ it 'does not let the user export the group' do
+ visit edit_group_path(group)
+
+ expect(page).to have_content('Page Not Found')
+ expect(page).not_to have_content('Export group')
+ end
+ end
+end
diff --git a/spec/features/issues/spam_issues_spec.rb b/spec/features/issues/spam_issues_spec.rb
index b6c936a6767..47e7022011d 100644
--- a/spec/features/issues/spam_issues_spec.rb
+++ b/spec/features/issues/spam_issues_spec.rb
@@ -103,8 +103,8 @@ describe 'New issue', :js do
click_button 'Submit issue'
- # it is impossible to test recaptcha automatically and there is no possibility to fill in recaptcha
- # recaptcha verification is skipped in test environment and it always returns true
+ # it is impossible to test reCAPTCHA automatically and there is no possibility to fill in recaptcha
+ # reCAPTCHA verification is skipped in test environment and it always returns true
expect(page).not_to have_content('issue title')
expect(page).to have_css('.recaptcha')
diff --git a/spec/features/snippets/spam_snippets_spec.rb b/spec/features/snippets/spam_snippets_spec.rb
index 8bba3e45824..bdcc1cc56e7 100644
--- a/spec/features/snippets/spam_snippets_spec.rb
+++ b/spec/features/snippets/spam_snippets_spec.rb
@@ -40,13 +40,13 @@ shared_examples_for 'snippet editor' do
end
end
- shared_examples 'solve recaptcha' do
- it 'creates a snippet after solving reCaptcha' do
+ shared_examples 'solve reCAPTCHA' do
+ it 'creates a snippet after solving reCAPTCHA' do
click_button('Create snippet')
wait_for_requests
- # it is impossible to test recaptcha automatically and there is no possibility to fill in recaptcha
- # recaptcha verification is skipped in test environment and it always returns true
+ # it is impossible to test reCAPTCHA automatically and there is no possibility to fill in recaptcha
+ # reCAPTCHA verification is skipped in test environment and it always returns true
expect(page).not_to have_content('My Snippet Title')
expect(page).to have_css('.recaptcha')
click_button('Submit personal snippet')
@@ -82,7 +82,7 @@ shared_examples_for 'snippet editor' do
end
context 'when allow_possible_spam feature flag is true' do
- it_behaves_like 'solve recaptcha'
+ it_behaves_like 'solve reCAPTCHA'
end
end