flashes_helper_spec.rb 666 B

1234567891011121314151617181920212223242526
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe FlashesHelper do
  4. describe 'user_facing_flashes' do
  5. before do
  6. # rubocop:disable Rails/I18nLocaleTexts
  7. flash[:alert] = 'an alert'
  8. flash[:error] = 'an error'
  9. flash[:notice] = 'a notice'
  10. flash[:success] = 'a success'
  11. flash[:not_user_facing] = 'a not user facing flash'
  12. # rubocop:enable Rails/I18nLocaleTexts
  13. end
  14. it 'returns user facing flashes' do
  15. expect(helper.user_facing_flashes).to eq(
  16. 'alert' => 'an alert',
  17. 'error' => 'an error',
  18. 'notice' => 'a notice',
  19. 'success' => 'a success'
  20. )
  21. end
  22. end
  23. end