Sha256: 4ff40367353a812a0efda1f77a90d37ec5146cab305db9a56720d59cde42f46f

Contents?: true

Size: 367 Bytes

Versions: 21

Compression:

Stored size: 367 Bytes

Contents

RSpec::Matchers.define(:permit) do |env|
  description do
    method      = env["REQUEST_METHOD"]
    credentials = Rails::Auth.credentials(env)
    message     = "allow #{method}s by "

    return message << "unauthenticated clients" if credentials.count.zero?

    message << credentials.values.map(&:inspect).join(", ")
  end

  match { |acl| acl.match(env) }
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rails-auth-0.1.0 lib/rails/auth/rspec/matchers/acl_matchers.rb