spec/fernet_spec.rb in fernet-2.0 vs spec/fernet_spec.rb in fernet-2.1

- old
+ new

@@ -17,21 +17,21 @@ it 'fails with a bad secret' do token = Fernet.generate(secret, 'harold@heroku.com') verifier = Fernet.verifier(bad_secret, token) - expect(verifier.valid?).to be_false + expect(verifier.valid?).to eq(false) expect { verifier.message }.to raise_error Fernet::Token::InvalidToken end it 'fails if the token is too old' do token = Fernet.generate(secret, 'harold@heroku.com', now: (Time.now - 61)) verifier = Fernet.verifier(secret, token) - expect(verifier.valid?).to be_false + expect(verifier.valid?).to eq(false) end it 'can ignore TTL enforcement' do Fernet::Configuration.run do |config| config.enforce_ttl = true @@ -39,22 +39,22 @@ token = Fernet.generate(secret, 'harold@heroku.com') verifier = Fernet.verifier(secret, token, enforce_ttl: false, now: Time.now + 9999) - expect(verifier.valid?).to be_true + expect(verifier.valid?).to eq(true) end it 'can ignore TTL enforcement via global config' do Fernet::Configuration.run do |config| config.enforce_ttl = false end token = Fernet.generate(secret, 'harold@heroku.com') verifier = Fernet.verifier(secret, token, now: Time.now + 999999) - expect(verifier.valid?).to be_true + expect(verifier.valid?).to eq(true) end it 'does not send the message in plain text' do token = Fernet.generate(secret, 'password1') @@ -67,9 +67,9 @@ config.ttl = 0 end token = Fernet.generate(secret, 'password1') verifier = Fernet.verifier(secret, token) verifier.enforce_ttl = false - expect(verifier.valid?).to be_true + expect(verifier.valid?).to eq(true) expect(verifier.message).to eq('password1') end end