Sha256: 98023987622e59259f0046be2a060b5a9a92a78a0c84184a34d4c795b388aca8

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

RSpec.describe "RSpec ACL matchers", acl_spec: true do
  let(:example_principal) { x509_principal_hash(ou: "ponycopter") }
  let(:another_principal) { x509_principal_hash(ou: "derpderp") }

  subject do
    Rails::Auth::ACL.from_yaml(
      fixture_path("example_acl.yml").read,
      matchers: {
        allow_x509_subject: Rails::Auth::X509::Matcher,
        allow_claims:       ClaimsPredicate
      }
    )
  end

  describe "/baz/quux" do
    it { is_expected.to permit get_request(principals: example_principal) }
    it { is_expected.not_to permit get_request(principals: another_principal) }
    it { is_expected.not_to permit get_request }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-auth-0.0.1 spec/rails/auth/rspec/matchers/acl_matchers_spec.rb