custom_emojis_spec.rb 710 B

123456789101112131415161718192021222324252627282930313233
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe 'Admin::CustomEmojis' 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_custom_emojis_path
  11. end
  12. context 'without selecting any records' do
  13. it 'displays a notice about selection' do
  14. click_on button_for_enable
  15. expect(page).to have_content(selection_error_text)
  16. end
  17. end
  18. def button_for_enable
  19. I18n.t('admin.custom_emojis.enable')
  20. end
  21. def selection_error_text
  22. I18n.t('admin.custom_emojis.no_emoji_selected')
  23. end
  24. end
  25. end