Sha256: b80600a12fbdd60d2845452d691cff25fbfe18eeb8bdee2848d0dcc59683c682

Contents?: true

Size: 361 Bytes

Versions: 1

Compression:

Stored size: 361 Bytes

Contents

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

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

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

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