reviewed 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/reviewed/version.rb +1 -1
- data/lib/reviewed/website.rb +4 -0
- data/spec/article_spec.rb +2 -2
- data/spec/base_spec.rb +7 -4
- data/spec/fixtures/vcr/article/attachments.yml +512 -234
- data/spec/fixtures/vcr/article/find_page.yml +166 -180
- data/spec/fixtures/vcr/article/products.yml +512 -234
- data/spec/fixtures/vcr/base/find_error_key.yml +127 -76
- data/spec/fixtures/vcr/base/find_ok.yml +1111 -220
- data/spec/fixtures/vcr/base/where_collection.yml +7832 -9725
- data/spec/fixtures/vcr/collection/products.yml +654 -1066
- data/spec/fixtures/vcr/product/attachments.yml +32 -148
- data/spec/fixtures/vcr/request/authors.yml +109 -120
- data/spec/fixtures/vcr/response/authors.yml +109 -120
- data/spec/request_spec.rb +1 -1
- data/spec/response_spec.rb +1 -1
- data/spec/website_spec.rb +9 -0
- metadata +2 -2
data/lib/reviewed/version.rb
CHANGED
data/lib/reviewed/website.rb
CHANGED
data/spec/article_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe Reviewed::Article do
|
|
6
6
|
|
7
7
|
it 'finds a page with a matching slug' do
|
8
8
|
article = Reviewed::Article.find('minden-master-ii-grill-review')
|
9
|
-
article.pages.length.should ==
|
9
|
+
article.pages.length.should == 9
|
10
10
|
page = article.find_page('performance')
|
11
11
|
page.should == article.pages[2]
|
12
12
|
page.name.should == 'Performance'
|
@@ -37,7 +37,7 @@ describe Reviewed::Article do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
it "returns the primary product" do
|
40
|
-
@product.
|
40
|
+
@product.name.should eql('Big Green Egg Medium')
|
41
41
|
end
|
42
42
|
|
43
43
|
it "returns a product of the correct class" do
|
data/spec/base_spec.rb
CHANGED
@@ -44,16 +44,19 @@ describe Reviewed::Base do
|
|
44
44
|
context 'with a valid request' do
|
45
45
|
use_vcr_cassette 'base/find_ok'
|
46
46
|
|
47
|
+
before(:each) do
|
48
|
+
@article = Reviewed::Article.find('big-green-egg-medium-charcoal-grill-review')
|
49
|
+
end
|
50
|
+
|
47
51
|
it 'fetches content from the api' do
|
48
|
-
model = Reviewed::Example.find(
|
52
|
+
model = Reviewed::Example.find(@article.id)
|
49
53
|
model.raw_response.should_not be_nil
|
50
54
|
end
|
51
55
|
|
52
56
|
it 'parses response json and returns an object' do
|
53
|
-
model = Reviewed::Example.find(
|
57
|
+
model = Reviewed::Example.find(@article.id)
|
54
58
|
model.class.should == Reviewed::Example
|
55
|
-
model.
|
56
|
-
model.name.should == 'Minden Master II Grill Review'
|
59
|
+
model.name.should == 'Big Green Egg Medium Charcoal Grill Review'
|
57
60
|
end
|
58
61
|
end
|
59
62
|
|