razsell 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,33 +0,0 @@
1
- require 'test_helper'
2
-
3
- class ProductLineParserTest < Test::Unit::TestCase
4
- context "parsing the document" do
5
- setup do
6
- @parser = Razsell::ProductLineParser.new
7
- end
8
-
9
- should "return an empty array when passed nil" do
10
- section = @parser.parse nil
11
- assert_equal Array, section.class
12
- assert_equal 0, section.length
13
- end
14
-
15
- should "get the relevent text from the document" do
16
- section = @parser.get_elements feed("productlines")
17
- assert_equal '<a href="http://www.zazzle.com/kungfutees/gifts?cg=196854021783912655">Cheeze</a>', section[0].to_html
18
- assert_equal '<a href="http://www.zazzle.com/kungfutees/gifts?cg=196596454716712290">New Products</a>', section[1].to_html
19
- assert_equal '<a href="http://www.zazzle.com/kungfutees/gifts?cg=196983228798280961">Smim</a>', section[2].to_html
20
- end
21
-
22
- should "populate the array with ProductLine objects" do
23
- section = @parser.parse feed("productlines")
24
- assert_equal '196854021783912655', section[0].id
25
- assert_equal '196596454716712290', section[1].id
26
- assert_equal '196983228798280961', section[2].id
27
-
28
- assert_equal 'Cheeze', section[0].name
29
- assert_equal 'New Products', section[1].name
30
- assert_equal 'Smim', section[2].name
31
- end
32
- end
33
- end