spec/rails/auth/x509/matcher_spec.rb in rails-auth-0.3.0 vs spec/rails/auth/x509/matcher_spec.rb in rails-auth-0.4.0
- old
+ new
@@ -7,15 +7,22 @@
let(:example_env) do
{ Rails::Auth::CREDENTIALS_ENV_KEY => { "x509" => example_certificate } }
end
- it "matches against a valid Rails::Auth::X509::Credential" do
- matcher = described_class.new(ou: example_ou)
- expect(matcher.match(example_env)).to eq true
+ describe "#match" do
+ it "matches against a valid Rails::Auth::X509::Credential" do
+ matcher = described_class.new(ou: example_ou)
+ expect(matcher.match(example_env)).to eq true
+ end
+
+ it "doesn't match if the subject mismatches" do
+ matcher = described_class.new(ou: another_ou)
+ expect(matcher.match(example_env)).to eq false
+ end
end
- it "doesn't match if the subject mismatches" do
- matcher = described_class.new(ou: another_ou)
- expect(matcher.match(example_env)).to eq false
+ it "knows its attributes" do
+ matcher = described_class.new(ou: example_ou)
+ expect(matcher.attributes).to eq(ou: example_ou)
end
end