dribbble-bucket-api 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,7 @@ module DribbbleBucketApi
|
|
13
13
|
def buckets
|
14
14
|
@buckets ||= document.css(".bucket-list > li").map do |bucket|
|
15
15
|
# parse bucket data from HTML
|
16
|
-
id = bucket["class"]
|
16
|
+
id = bucket["class"] =~ /^bucket\-(\d+)$/ && $1.to_i
|
17
17
|
name = bucket.css(".bucket-title a").first.text
|
18
18
|
# pass data into bucket object
|
19
19
|
Bucket.new(id: id, name: name, username: username)
|
@@ -64,6 +64,11 @@ describe DribbbleBucketApi::BucketIndexParser do
|
|
64
64
|
expect(bucket).to be_kind_of DribbbleBucketApi::Bucket
|
65
65
|
end
|
66
66
|
end
|
67
|
+
|
68
|
+
it "should parse the ids correctly" do
|
69
|
+
ids = subject.buckets.map(&:id)
|
70
|
+
expect(ids).to eq [12345, 67890, 98760, 54321, 12093]
|
71
|
+
end
|
67
72
|
end
|
68
73
|
|
69
74
|
describe "#current_page" do
|