reviewed 0.7.1 → 0.8.0
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.
- checksums.yaml +4 -4
- data/lib/reviewed/attachable.rb +1 -1
- data/lib/reviewed/base.rb +4 -3
- data/lib/reviewed/client.rb +6 -1
- data/lib/reviewed/collection.rb +1 -1
- data/lib/reviewed/request.rb +5 -5
- data/lib/reviewed/version.rb +1 -1
- data/spec/attachable_spec.rb +4 -0
- data/spec/base_spec.rb +10 -0
- data/spec/client_spec.rb +10 -7
- data/spec/collection_spec.rb +6 -0
- data/spec/fixtures/vcr/Reviewed_Article/uses_the_client_to_fetch.yml +1678 -0
- data/spec/fixtures/vcr/Reviewed_Article/uses_the_client_to_fetch_scoped_attachments.yml +797 -0
- data/spec/fixtures/vcr/Reviewed_Collection/collection_data/passes_the_client_to_each_object.yml +85 -0
- data/spec/fixtures/vcr/Reviewed_Request/object_from_response/passes_the_client_to_the_object.yml +499 -0
- data/spec/request_spec.rb +7 -1
- metadata +10 -2
data/spec/request_spec.rb
CHANGED
@@ -7,7 +7,8 @@ describe Reviewed::Request do
|
|
7
7
|
|
8
8
|
let(:request) do
|
9
9
|
Reviewed::Request.new(
|
10
|
-
resource: Reviewed::Article
|
10
|
+
resource: Reviewed::Article,
|
11
|
+
client: Reviewed::Client.new
|
11
12
|
)
|
12
13
|
end
|
13
14
|
|
@@ -129,6 +130,11 @@ describe Reviewed::Request do
|
|
129
130
|
response = request.object_from_response(:get, "articles/#{article_id}")
|
130
131
|
response.should be_an_instance_of(request.resource)
|
131
132
|
end
|
133
|
+
|
134
|
+
it 'passes the client to the object' do
|
135
|
+
response = request.object_from_response(:get, "articles/#{article_id}")
|
136
|
+
response.client.should eql(request.client)
|
137
|
+
end
|
132
138
|
end
|
133
139
|
|
134
140
|
describe 'collection_from_response', vcr: true do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reviewed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Plante
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -273,10 +273,13 @@ files:
|
|
273
273
|
- spec/fixtures/vcr/Reviewed_Article/primary_product/returns_nil_if_does_not_respond_to_products.yml
|
274
274
|
- spec/fixtures/vcr/Reviewed_Article/primary_product/returns_the_primary_product.yml
|
275
275
|
- spec/fixtures/vcr/Reviewed_Article/returns_local_attachments_when_available.yml
|
276
|
+
- spec/fixtures/vcr/Reviewed_Article/uses_the_client_to_fetch.yml
|
277
|
+
- spec/fixtures/vcr/Reviewed_Article/uses_the_client_to_fetch_scoped_attachments.yml
|
276
278
|
- spec/fixtures/vcr/Reviewed_Client/_perform/request_params/not_set/has_nil_query_params.yml
|
277
279
|
- spec/fixtures/vcr/Reviewed_Client/_perform/request_params/set/merges_quest_params.yml
|
278
280
|
- spec/fixtures/vcr/Reviewed_Collection/collection_data/fetches_the_first_page_by_default.yml
|
279
281
|
- spec/fixtures/vcr/Reviewed_Collection/collection_data/is_enumerable.yml
|
282
|
+
- spec/fixtures/vcr/Reviewed_Collection/collection_data/passes_the_client_to_each_object.yml
|
280
283
|
- spec/fixtures/vcr/Reviewed_Collection/next_page/fetches_the_next_page_of_results.yml
|
281
284
|
- spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/indicates_if_the_page_number_is_out_of_bounds.yml
|
282
285
|
- spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/indicates_whether_this_is_the_first_or_last_page.yml
|
@@ -300,6 +303,7 @@ files:
|
|
300
303
|
- spec/fixtures/vcr/Reviewed_Request/_where/returns_the_appropriate_page_of_results.yml
|
301
304
|
- spec/fixtures/vcr/Reviewed_Request/collection_from_response/returns_a_collection_object.yml
|
302
305
|
- spec/fixtures/vcr/Reviewed_Request/collection_from_response/returns_objects_of_the_correct_class.yml
|
306
|
+
- spec/fixtures/vcr/Reviewed_Request/object_from_response/passes_the_client_to_the_object.yml
|
303
307
|
- spec/fixtures/vcr/Reviewed_Request/object_from_response/returns_an_object_of_the_correct_class.yml
|
304
308
|
- spec/product_spec.rb
|
305
309
|
- spec/request_spec.rb
|
@@ -359,10 +363,13 @@ test_files:
|
|
359
363
|
- spec/fixtures/vcr/Reviewed_Article/primary_product/returns_nil_if_does_not_respond_to_products.yml
|
360
364
|
- spec/fixtures/vcr/Reviewed_Article/primary_product/returns_the_primary_product.yml
|
361
365
|
- spec/fixtures/vcr/Reviewed_Article/returns_local_attachments_when_available.yml
|
366
|
+
- spec/fixtures/vcr/Reviewed_Article/uses_the_client_to_fetch.yml
|
367
|
+
- spec/fixtures/vcr/Reviewed_Article/uses_the_client_to_fetch_scoped_attachments.yml
|
362
368
|
- spec/fixtures/vcr/Reviewed_Client/_perform/request_params/not_set/has_nil_query_params.yml
|
363
369
|
- spec/fixtures/vcr/Reviewed_Client/_perform/request_params/set/merges_quest_params.yml
|
364
370
|
- spec/fixtures/vcr/Reviewed_Collection/collection_data/fetches_the_first_page_by_default.yml
|
365
371
|
- spec/fixtures/vcr/Reviewed_Collection/collection_data/is_enumerable.yml
|
372
|
+
- spec/fixtures/vcr/Reviewed_Collection/collection_data/passes_the_client_to_each_object.yml
|
366
373
|
- spec/fixtures/vcr/Reviewed_Collection/next_page/fetches_the_next_page_of_results.yml
|
367
374
|
- spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/indicates_if_the_page_number_is_out_of_bounds.yml
|
368
375
|
- spec/fixtures/vcr/Reviewed_Collection/page_attributes_pagination_/indicates_whether_this_is_the_first_or_last_page.yml
|
@@ -386,6 +393,7 @@ test_files:
|
|
386
393
|
- spec/fixtures/vcr/Reviewed_Request/_where/returns_the_appropriate_page_of_results.yml
|
387
394
|
- spec/fixtures/vcr/Reviewed_Request/collection_from_response/returns_a_collection_object.yml
|
388
395
|
- spec/fixtures/vcr/Reviewed_Request/collection_from_response/returns_objects_of_the_correct_class.yml
|
396
|
+
- spec/fixtures/vcr/Reviewed_Request/object_from_response/passes_the_client_to_the_object.yml
|
389
397
|
- spec/fixtures/vcr/Reviewed_Request/object_from_response/returns_an_object_of_the_correct_class.yml
|
390
398
|
- spec/product_spec.rb
|
391
399
|
- spec/request_spec.rb
|