Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dennis O'Connor
committed
Feb 13, 2012
1 parent
b25e7a3
commit c7a8ca2
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module ShopifyAPI | ||
class Cart < Base | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require 'test_helper' | ||
|
||
class CartTest < Test::Unit::TestCase | ||
test 'all should return all carts' do | ||
fake 'carts' | ||
carts = ShopifyAPI::Cart.all | ||
assert_equal carts.size, 2 | ||
assert_equal 2, carts.first.id | ||
assert_equal "3eed8183d4281db6ea82ee2b8f23e9cc", carts.first.token | ||
assert_equal 1, carts.first.line_items.size | ||
assert_equal 'test', carts.first.line_items.first.title | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"carts": [ | ||
{ | ||
"id": 2, | ||
"note": null, | ||
"token": "3eed8183d4281db6ea82ee2b8f23e9cc", | ||
"updated_at": "2012-02-13T14:39:37-05:00", | ||
"line_items": | ||
[ | ||
{ | ||
"id": 1, | ||
"title": "test", | ||
"price": "1.00", | ||
"line_price": "1.00", | ||
"quantity": 1, | ||
"sku": "", | ||
"grams": 1000, | ||
"vendor": "test", | ||
"variant_id": 1 | ||
} | ||
] | ||
}, | ||
{ | ||
"id": 1, | ||
"note": "", | ||
"token": "49801807939c296be1e9a4bf6783a705", | ||
"updated_at": "2012-02-13T14:39:12-05:00", | ||
"line_items":[ | ||
{ | ||
"id": 1, | ||
"title": "test", | ||
"price": "1.00", | ||
"line_price": "1.00", | ||
"quantity": 1, | ||
"sku": "", | ||
"grams": 1000, | ||
"vendor": "test", | ||
"variant_id": 1 | ||
} | ||
] | ||
} | ||
] | ||
} |