Sha256: b5199c155861e869431f80e4726296821ef1b3614173c8656e0dde74e53003b6
Contents?: true
Size: 763 Bytes
Versions: 9
Compression:
Stored size: 763 Bytes
Contents
require 'rails_helper' RSpec.describe Exposition::Admin::FlashesHelper, type: :helper do it "converts the the flash into a hash" do flash = double("flash") allow(flash).to receive(:to_hash).and_return({}) allow(helper).to receive(:flash).and_return(flash) helper.user_facing_flashes expect(flash).to have_received(:to_hash) end it "removes unneeded keys" do flash = { "a" => "1", "alert" => "2", "error" => "3", "notice" => "4", "success" => "5" } allow(helper).to receive(:flash).and_return(flash) processed_flash = helper.user_facing_flashes expect(processed_flash).to include("alert") expect(processed_flash).to_not include("a") end end
Version data entries
9 entries across 9 versions & 1 rubygems