Skip to content

Commit

Permalink
Update spec/unleash/constraint_spec.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Renato Arruda <rarruda@rarruda.org>
  • Loading branch information
sighphyre and rarruda committed Mar 7, 2022
1 parent 2237423 commit 706d24c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion spec/unleash/constraint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,28 @@
context = Unleash::Context.new(context_params)

constraint = Unleash::Constraint.new('currentTime', 'DATE_AFTER', '2022-01-29T13:00:00.000Z')
expect(constraint.matches_context?(context)).to be_truthy
expect(constraint.matches_context?(context)).to be true

constraint = Unleash::Constraint.new('currentTime', 'DATE_AFTER', '2022-01-29T13:00:00Z')
expect(constraint.matches_context?(context)).to be true

constraint = Unleash::Constraint.new('currentTime', 'DATE_AFTER', '2022-01-29T13:00Z')
expect(constraint.matches_context?(context)).to be true

constraint = Unleash::Constraint.new('currentTime', 'DATE_AFTER', '2022-01-30T12:59:59.999999Z')
expect(constraint.matches_context?(context)).to be true

constraint = Unleash::Constraint.new('currentTime', 'DATE_AFTER', '2022-01-30T12:59:59.999Z')
expect(constraint.matches_context?(context)).to be true

constraint = Unleash::Constraint.new('currentTime', 'DATE_AFTER', '2022-01-30T12:59:59')
expect(constraint.matches_context?(context)).to be true

constraint = Unleash::Constraint.new('currentTime', 'DATE_AFTER', '2022-01-30T12:59')
expect(constraint.matches_context?(context)).to be true

constraint = Unleash::Constraint.new('currentTime', 'DATE_AFTER', '2022-01-30T13:00:00.000Z')
expect(constraint.matches_context?(context)).to be false

constraint = Unleash::Constraint.new('currentTime', 'DATE_AFTER', '2022-01-31T13:00:00.000Z')
expect(constraint.matches_context?(context)).to be_falsey
Expand Down

0 comments on commit 706d24c

Please sign in to comment.