email_domain_blocks_spec.rb 746 B

123456789101112131415161718192021222324252627282930313233
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe 'Admin::EmailDomainBlocks' do
  4. let(:current_user) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')) }
  5. before do
  6. sign_in current_user
  7. end
  8. describe 'Performing batch updates' do
  9. before do
  10. visit admin_email_domain_blocks_path
  11. end
  12. context 'without selecting any records' do
  13. it 'displays a notice about selection' do
  14. click_on button_for_delete
  15. expect(page).to have_content(selection_error_text)
  16. end
  17. end
  18. def button_for_delete
  19. I18n.t('admin.email_domain_blocks.delete')
  20. end
  21. def selection_error_text
  22. I18n.t('admin.email_domain_blocks.no_email_domain_block_selected')
  23. end
  24. end
  25. end