summaryrefslogtreecommitdiff
path: root/spec/helpers/import_helper_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/import_helper_spec.rb')
-rw-r--r--spec/helpers/import_helper_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/helpers/import_helper_spec.rb b/spec/helpers/import_helper_spec.rb
index 18cbbdfd804..7a5a69ea5b5 100644
--- a/spec/helpers/import_helper_spec.rb
+++ b/spec/helpers/import_helper_spec.rb
@@ -49,4 +49,20 @@ RSpec.describe ImportHelper do
expect(helper.provider_project_link_url(host_url, full_path)).to match('http://provider.com/repo/path')
end
end
+
+ describe '#import_configure_github_admin_message' do
+ subject { helper.import_configure_github_admin_message }
+
+ it 'returns note for admin' do
+ allow(helper).to receive(:current_user) { instance_double('User', can_admin_all_resources?: true) }
+
+ is_expected.to have_text('Note: As an administrator')
+ end
+
+ it 'returns note for other user' do
+ allow(helper).to receive(:current_user) { instance_double('User', can_admin_all_resources?: false) }
+
+ is_expected.to have_text('Note: Consider asking your GitLab administrator')
+ end
+ end
end