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/admin/admin_browse_spam_logs_spec.rb')
-rw-r--r--spec/features/admin/admin_browse_spam_logs_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/features/admin/admin_browse_spam_logs_spec.rb b/spec/features/admin/admin_browse_spam_logs_spec.rb
index c272a8630b7..f781e2adf07 100644
--- a/spec/features/admin/admin_browse_spam_logs_spec.rb
+++ b/spec/features/admin/admin_browse_spam_logs_spec.rb
@@ -4,9 +4,9 @@ require 'spec_helper'
RSpec.describe 'Admin browse spam logs', feature_category: :shared do
let!(:spam_log) { create(:spam_log, description: 'abcde ' * 20) }
+ let(:admin) { create(:admin) }
before do
- admin = create(:admin)
sign_in(admin)
gitlab_enable_admin_mode_sign_in(admin)
end
@@ -22,6 +22,7 @@ RSpec.describe 'Admin browse spam logs', feature_category: :shared do
expect(page).to have_content("#{spam_log.description[0...97]}...")
expect(page).to have_link('Remove user')
expect(page).to have_link('Block user')
+ expect(page).to have_link('Trust user')
end
it 'does not perform N+1 queries' do
@@ -30,4 +31,15 @@ RSpec.describe 'Admin browse spam logs', feature_category: :shared do
expect { visit admin_spam_logs_path }.not_to exceed_query_limit(control_queries)
end
+
+ context 'when user is trusted' do
+ before do
+ UserCustomAttribute.set_trusted_by(user: spam_log.user, trusted_by: admin)
+ end
+
+ it 'allows admin to untrust the user' do
+ visit admin_spam_logs_path
+ expect(page).to have_link('Untrust user')
+ end
+ end
end