pboling/stackable_flash

View on GitHub
lib/stackable_flash/test_helpers.rb

Summary

Maintainability
A
0 mins
Test Coverage
module StackableFlash
  module TestHelpers

    # slash is shorthand for stackable_flash
    def flash_in_stack(slash_for_status, expecting)
      return true if slash_for_status == expecting
      if slash_for_status.kind_of?(Array)
        matches = slash_for_status.select do |to_check|
          to_check == expecting
        end
        return matches.length > 0
      end
    end

  end
end