mad_cart 0.0.7 → 0.0.8

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.
@@ -3,6 +3,7 @@ require "spec_helper"
3
3
  describe MadCart::Store::Spree do
4
4
 
5
5
  let(:spree_cassette) { 'spree' }
6
+ let(:spree_alternative_cassette) { 'spree_alternative' }
6
7
  let(:spree_no_records_cassette) { 'spree_no_records' }
7
8
  let(:spree_invalid_key_cassette) { 'spree_invalid_key' }
8
9
 
@@ -13,6 +14,13 @@ describe MadCart::Store::Spree do
13
14
  }
14
15
  }
15
16
 
17
+ let(:valid_alternative_credentials) {
18
+ {
19
+ :api_key => '3d5216bcb9253377d7d354222a55bd32751f7fccc963b4ea',
20
+ :store_url => 'localhost:3002'
21
+ }
22
+ }
23
+
16
24
  describe "store" do
17
25
 
18
26
  it "expects to be instantiated with an api key and store url" do
@@ -26,18 +34,39 @@ describe MadCart::Store::Spree do
26
34
 
27
35
  context "retrieval" do
28
36
 
29
- it "returns all products" do
30
- VCR.use_cassette(spree_cassette, :record => :new_episodes) do
31
- api = MadCart::Store::Spree.new(valid_credentials)
37
+ context "basic spree installation" do
38
+ it "returns all products" do
39
+ VCR.use_cassette(spree_cassette, :record => :new_episodes) do
40
+ api = MadCart::Store::Spree.new(valid_credentials)
41
+
42
+ api.products.size.should == 58
43
+
44
+ first_product = api.products.first
45
+
46
+ first_product.should be_a(MadCart::Model::Product)
47
+ first_product.name.should_not be_nil
48
+ first_product.description.should_not be_nil
49
+ first_product.image_url.should_not be_nil
50
+ first_product.additional_attributes['price'].should_not be_nil
51
+ end
52
+ end
53
+ end
54
+
55
+ context "alternative spree installation" do
56
+ it "returns all products" do
57
+ VCR.use_cassette(spree_alternative_cassette, :record => :new_episodes) do
58
+ api = MadCart::Store::Spree.new(valid_alternative_credentials)
32
59
 
33
- api.products.size.should == 58
60
+ api.products.size.should == 148
34
61
 
35
- first_product = api.products.first
62
+ first_product = api.products.first
36
63
 
37
- first_product.should be_a(MadCart::Model::Product)
38
- first_product.name.should_not be_nil
39
- first_product.description.should_not be_nil
40
- first_product.image_url.should_not be_nil
64
+ first_product.should be_a(MadCart::Model::Product)
65
+ first_product.name.should_not be_nil
66
+ first_product.description.should_not be_nil
67
+ first_product.image_url.should_not be_nil
68
+ first_product.additional_attributes['price'].should_not be_nil
69
+ end
41
70
  end
42
71
  end
43
72
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mad_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Heiligers
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-11 00:00:00.000000000 Z
13
+ date: 2015-02-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -231,6 +231,7 @@ files:
231
231
  - spec/fixtures/vcr_cassettes/etsy_store_does_not_exist.yml
232
232
  - spec/fixtures/vcr_cassettes/etsy_store_listings.yml
233
233
  - spec/fixtures/vcr_cassettes/spree.yml
234
+ - spec/fixtures/vcr_cassettes/spree_alternative.yml
234
235
  - spec/fixtures/vcr_cassettes/spree_invalid_key.yml
235
236
  - spec/fixtures/vcr_cassettes/spree_no_records.yml
236
237
  - spec/lib/configuration_spec.rb
@@ -280,6 +281,7 @@ test_files:
280
281
  - spec/fixtures/vcr_cassettes/etsy_store_does_not_exist.yml
281
282
  - spec/fixtures/vcr_cassettes/etsy_store_listings.yml
282
283
  - spec/fixtures/vcr_cassettes/spree.yml
284
+ - spec/fixtures/vcr_cassettes/spree_alternative.yml
283
285
  - spec/fixtures/vcr_cassettes/spree_invalid_key.yml
284
286
  - spec/fixtures/vcr_cassettes/spree_no_records.yml
285
287
  - spec/lib/configuration_spec.rb