Skip to content

Commit

Permalink
Add some additional to_liquid_value assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanahsmith committed Jan 13, 2023
1 parent cdb5cb0 commit 619ed3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/integration/variable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ def test_variable_lookup_calls_to_liquid_value

def test_if_tag_calls_to_liquid_value
assert_template_result('one', '{% if foo == 1 %}one{% endif %}', { 'foo' => IntegerDrop.new('1') })
assert_template_result('one', '{% if foo == eqv %}one{% endif %}', { 'foo' => IntegerDrop.new(1), 'eqv' => IntegerDrop.new(1) })
assert_template_result('one', '{% if 0 < foo %}one{% endif %}', { 'foo' => IntegerDrop.new('1') })
assert_template_result('one', '{% if foo > 0 %}one{% endif %}', { 'foo' => IntegerDrop.new('1') })
assert_template_result('one', '{% if b > a %}one{% endif %}', { 'b' => IntegerDrop.new(1), 'a' => IntegerDrop.new(0) })
assert_template_result('true', '{% if foo == true %}true{% endif %}', { 'foo' => BooleanDrop.new(true) })
assert_template_result('true', '{% if foo %}true{% endif %}', { 'foo' => BooleanDrop.new(true) })

assert_template_result('', '{% if foo %}true{% endif %}', { 'foo' => BooleanDrop.new(false) })
assert_template_result('', '{% if foo == true %}True{% endif %}', { 'foo' => BooleanDrop.new(false) })

assert_template_result('one', '{% if a contains x %}one{% endif %}', { 'a' => [1], 'x' => IntegerDrop.new(1) })
end

def test_unless_tag_calls_to_liquid_value
Expand Down

0 comments on commit 619ed3f

Please sign in to comment.