Sha256: 62b10b1cfa2f76a224d66f5dc8164c9404bae3d73344fee82f355a384bfd6862

Contents?: true

Size: 822 Bytes

Versions: 13

Compression:

Stored size: 822 Bytes

Contents

require 'rails_helper'

RSpec.describe ActiveAdmin::ViewHelpers::FlashHelper do

  describe '.flash_messages' do
    let(:view) { action_view }

    it "should not include 'timedout' flash messages by default" do
      view.request.flash[:alert] = "Alert"
      view.request.flash[:timedout] = true
      expect(view.flash_messages).to include 'alert'
      expect(view.flash_messages).to_not include 'timedout'
    end

    it "should not return flash messages included in flash_keys_to_except" do
      expect(view.active_admin_application).to receive(:flash_keys_to_except).and_return ["hideme"]
      view.request.flash[:alert] = "Alert"
      view.request.flash[:hideme] = "Do not show"
      expect(view.flash_messages).to include 'alert'
      expect(view.flash_messages).to_not include 'hideme'
    end

  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/view_helpers/flash_helper_spec.rb
activeadmin-rb-1.4.0 spec/unit/view_helpers/flash_helper_spec.rb
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/view_helpers/flash_helper_spec.rb
activeadmin-1.3.1 spec/unit/view_helpers/flash_helper_spec.rb
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/view_helpers/flash_helper_spec.rb
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/view_helpers/flash_helper_spec.rb
activeadmin-1.3.0 spec/unit/view_helpers/flash_helper_spec.rb
activeadmin_addons-1.4.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/view_helpers/flash_helper_spec.rb
activeadmin_addons-1.3.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/view_helpers/flash_helper_spec.rb
activeadmin_addons-1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/spec/unit/view_helpers/flash_helper_spec.rb
activeadmin-1.2.1 spec/unit/view_helpers/flash_helper_spec.rb
activeadmin-1.2.0 spec/unit/view_helpers/flash_helper_spec.rb
activeadmin-1.1.0 spec/unit/view_helpers/flash_helper_spec.rb