Skip to content

Commit

Permalink
fix: add test case for missing context field
Browse files Browse the repository at this point in the history
  • Loading branch information
ivarconr committed Jun 21, 2022
1 parent 51a8619 commit ee4dd93
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/unleash/constraint_spec.rb
Expand Up @@ -405,5 +405,12 @@
end.to raise_error
end
end

it 'handles missing custom field context' do
context_params = {}
context = Unleash::Context.new(context_params)
constraint = Unleash::Constraint.new('customField', 'STR_STARTS_WITH', ['customField'])
expect(constraint.matches_context?(context)).to be false
end
end
end

0 comments on commit ee4dd93

Please sign in to comment.