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-2.1.4 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-2.1.3 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-2.1.2 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-2.1.1 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-2.1.0 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-2.0.3 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-2.0.2 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-2.0.1 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-1.3.0 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-1.2.0 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-1.1.0 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-1.0.0 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-0.5.3 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-0.5.2 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-0.5.1 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-0.5.0 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-0.4.1 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-0.4.0 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-0.3.0 lib/rails/auth/rspec/matchers/acl_matchers.rb
rails-auth-0.2.0 lib/rails/auth/rspec/matchers/acl_matchers.rb