lib/rails/auth/rspec/matchers/acl_matchers.rb in rails-auth-0.0.1 vs lib/rails/auth/rspec/matchers/acl_matchers.rb in rails-auth-0.1.0

- old
+ new

@@ -1,13 +1,13 @@ RSpec::Matchers.define(:permit) do |env| description do - method = env["REQUEST_METHOD"] - principals = Rails::Auth.principals(env) - message = "allow #{method}s by " + method = env["REQUEST_METHOD"] + credentials = Rails::Auth.credentials(env) + message = "allow #{method}s by " - return message << "unauthenticated clients" if principals.count.zero? + return message << "unauthenticated clients" if credentials.count.zero? - message << principals.values.map(&:inspect).join(", ") + message << credentials.values.map(&:inspect).join(", ") end match { |acl| acl.match(env) } end