spec/rails/auth/acl/matchers/allow_all_spec.rb in rails-auth-0.3.0 vs spec/rails/auth/acl/matchers/allow_all_spec.rb in rails-auth-0.4.0
- old
+ new
@@ -1,7 +1,7 @@
RSpec.describe Rails::Auth::ACL::Matchers::AllowAll do
- let(:predicate) { described_class.new(enabled) }
+ let(:matcher) { described_class.new(enabled) }
let(:example_env) { env_for(:get, "/") }
describe "#initialize" do
it "raises if given nil" do
expect { described_class.new(nil) }.to raise_error(ArgumentError)
@@ -15,18 +15,23 @@
describe "#match" do
context "enabled" do
let(:enabled) { true }
it "allows all requests" do
- expect(predicate.match(example_env)).to eq true
+ expect(matcher.match(example_env)).to eq true
end
end
context "disabled" do
let(:enabled) { false }
it "rejects all requests" do
- expect(predicate.match(example_env)).to eq false
+ expect(matcher.match(example_env)).to eq false
end
end
+ end
+
+ it "knows its attributes" do
+ matcher = described_class.new(true)
+ expect(matcher.attributes).to eq true
end
end