Skip to content

Commit

Permalink
test multivalued attribute fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kvanhecke committed Nov 9, 2010
1 parent c71d6d2 commit d18bf79
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions test/test_arrays.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,10 @@ def test_array_multivalued

client = Sugestio.new('sandbox', 'demo')

item = {:id => 7, :category => ["pop", "rock"], :from => "2010-11-01", :until => "2010-12-01"}
item = {:id => 7, "category[]" => ["pop", "rock"], :from => "2010-11-01", :until => "2010-12-01"}
result = client.add_item(item)

assert_equal(2, result['item'][0]['category'].length)
end

def test_array_nested

client = Sugestio.new('sandbox', 'demo')

item = {:id => 7, :category => {"0" => "pop", "1" => "rock"}, :from => "2010-11-01", :until => "2010-12-01"}
result = client.add_item(item)

assert_equal(2, result['item'][0]['category'].length)
end


end

0 comments on commit d18bf79

Please sign in to comment.