spark_api 1.4.34 → 1.5.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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/VERSION +1 -1
  4. data/lib/spark_api/authentication/api_auth.rb +1 -1
  5. data/lib/spark_api/authentication/oauth2.rb +1 -1
  6. data/lib/spark_api/authentication/oauth2_impl/grant_type_base.rb +1 -1
  7. data/lib/spark_api/client.rb +2 -2
  8. data/lib/spark_api/request.rb +1 -1
  9. data/spec/spec_helper.rb +9 -4
  10. data/spec/unit/spark_api/authentication/api_auth_spec.rb +21 -22
  11. data/spec/unit/spark_api/authentication/base_auth_spec.rb +3 -3
  12. data/spec/unit/spark_api/authentication/oauth2_impl/faraday_middleware_spec.rb +1 -1
  13. data/spec/unit/spark_api/authentication/oauth2_impl/grant_type_base_spec.rb +1 -1
  14. data/spec/unit/spark_api/authentication/oauth2_impl/single_session_provider_spec.rb +2 -2
  15. data/spec/unit/spark_api/authentication/oauth2_spec.rb +40 -40
  16. data/spec/unit/spark_api/authentication_spec.rb +2 -2
  17. data/spec/unit/spark_api/configuration/yaml_spec.rb +44 -44
  18. data/spec/unit/spark_api/configuration_spec.rb +56 -57
  19. data/spec/unit/spark_api/faraday_middleware_spec.rb +12 -12
  20. data/spec/unit/spark_api/models/account_spec.rb +20 -20
  21. data/spec/unit/spark_api/models/activity_spec.rb +5 -5
  22. data/spec/unit/spark_api/models/base_spec.rb +32 -32
  23. data/spec/unit/spark_api/models/concerns/destroyable_spec.rb +2 -2
  24. data/spec/unit/spark_api/models/concerns/savable_spec.rb +19 -19
  25. data/spec/unit/spark_api/models/connect_prefs_spec.rb +1 -1
  26. data/spec/unit/spark_api/models/constraint_spec.rb +1 -1
  27. data/spec/unit/spark_api/models/contact_spec.rb +50 -50
  28. data/spec/unit/spark_api/models/dirty_spec.rb +12 -12
  29. data/spec/unit/spark_api/models/document_spec.rb +3 -3
  30. data/spec/unit/spark_api/models/fields_spec.rb +17 -17
  31. data/spec/unit/spark_api/models/finders_spec.rb +7 -7
  32. data/spec/unit/spark_api/models/floplan_spec.rb +4 -4
  33. data/spec/unit/spark_api/models/listing_cart_spec.rb +46 -46
  34. data/spec/unit/spark_api/models/listing_meta_translations_spec.rb +6 -6
  35. data/spec/unit/spark_api/models/listing_spec.rb +91 -91
  36. data/spec/unit/spark_api/models/message_spec.rb +10 -10
  37. data/spec/unit/spark_api/models/note_spec.rb +10 -10
  38. data/spec/unit/spark_api/models/notification_spec.rb +6 -6
  39. data/spec/unit/spark_api/models/open_house_spec.rb +4 -4
  40. data/spec/unit/spark_api/models/photo_spec.rb +8 -8
  41. data/spec/unit/spark_api/models/portal_spec.rb +4 -4
  42. data/spec/unit/spark_api/models/property_types_spec.rb +5 -5
  43. data/spec/unit/spark_api/models/rental_calendar_spec.rb +13 -11
  44. data/spec/unit/spark_api/models/rule_spec.rb +2 -2
  45. data/spec/unit/spark_api/models/saved_search_spec.rb +33 -33
  46. data/spec/unit/spark_api/models/search_template/quick_search_spec.rb +5 -5
  47. data/spec/unit/spark_api/models/shared_listing_spec.rb +12 -12
  48. data/spec/unit/spark_api/models/sort_spec.rb +3 -3
  49. data/spec/unit/spark_api/models/standard_fields_spec.rb +12 -12
  50. data/spec/unit/spark_api/models/subresource_spec.rb +18 -18
  51. data/spec/unit/spark_api/models/system_info_spec.rb +7 -7
  52. data/spec/unit/spark_api/models/tour_of_home_spec.rb +3 -3
  53. data/spec/unit/spark_api/models/video_spec.rb +9 -9
  54. data/spec/unit/spark_api/models/virtual_tour_spec.rb +7 -7
  55. data/spec/unit/spark_api/models/vow_account_spec.rb +8 -8
  56. data/spec/unit/spark_api/multi_client_spec.rb +14 -14
  57. data/spec/unit/spark_api/options_hash_spec.rb +4 -4
  58. data/spec/unit/spark_api/paginate_spec.rb +71 -71
  59. data/spec/unit/spark_api/primary_array_spec.rb +5 -5
  60. data/spec/unit/spark_api/request_spec.rb +60 -60
  61. data/spec/unit/spark_api_spec.rb +6 -6
  62. metadata +162 -233
@@ -10,9 +10,9 @@ describe Activity do
10
10
  it "gets a current user's activities" do
11
11
  s = stub_api_get("/activities", "activities/get.json")
12
12
  activities = Activity.get
13
- activities.should be_an(Array)
14
- activities.size.should eq(2)
15
- s.should have_been_requested
13
+ expect(activities).to be_an(Array)
14
+ expect(activities.size).to eq(2)
15
+ expect(s).to have_been_requested
16
16
  end
17
17
  end
18
18
 
@@ -21,8 +21,8 @@ describe Activity do
21
21
  it "gets an individual activity" do
22
22
  s = stub_api_get("/activities/#{id}", "activities/get.json")
23
23
  activity = Activity.find(id)
24
- activity.should be_an(Activity)
25
- s.should have_been_requested
24
+ expect(activity).to be_an(Activity)
25
+ expect(s).to have_been_requested
26
26
  end
27
27
  end
28
28
 
@@ -22,31 +22,31 @@ describe MyExampleModel, "Example model" do
22
22
  end
23
23
 
24
24
  it "should be persisted" do
25
- @model.persisted?.should eq(true)
25
+ expect(@model.persisted?).to eq(true)
26
26
  end
27
27
 
28
28
  it "should not be persisted" do
29
29
  @new_model = MyExampleModel.new()
30
- @new_model.persisted?.should eq(false)
30
+ expect(@new_model.persisted?).to eq(false)
31
31
  end
32
32
 
33
33
  it "should parse and return ResourceUri without v1" do
34
- @model.resource_uri.should eq("/some/place/20101230223226074201000000")
34
+ expect(@model.resource_uri).to eq("/some/place/20101230223226074201000000")
35
35
  end
36
36
 
37
37
  it "should parse and return the correct path for a persisted resource" do
38
- @model.path.should eq("/some/place")
38
+ expect(@model.path).to eq("/some/place")
39
39
  end
40
40
 
41
41
  it "should parse and return the correct path" do
42
42
  @model = MyExampleModel.new
43
- @model.path.should eq("/test/example")
43
+ expect(@model.path).to eq("/test/example")
44
44
  end
45
45
 
46
46
  it "should parse and return the correct path for resource with a parent" do
47
47
  @model = MyExampleModel.new
48
48
  @model.parent = Contact.new({ :Id => "20101230223226074201000000" })
49
- @model.path.should eq("/contacts/20101230223226074201000000/test/example")
49
+ expect(@model.path).to eq("/contacts/20101230223226074201000000/test/example")
50
50
  end
51
51
 
52
52
  end
@@ -55,16 +55,16 @@ describe Base, "Base model" do
55
55
 
56
56
  describe "class methods" do
57
57
  it "should set the element name" do
58
- MyExampleModel.element_name.should eq("example")
59
- MyDefaultModel.element_name.should eq("resource")
58
+ expect(MyExampleModel.element_name).to eq("example")
59
+ expect(MyDefaultModel.element_name).to eq("resource")
60
60
  end
61
61
  it "should set the prefix" do
62
- MyExampleModel.prefix.should eq("/test/")
63
- MyDefaultModel.prefix.should eq("/")
62
+ expect(MyExampleModel.prefix).to eq("/test/")
63
+ expect(MyDefaultModel.prefix).to eq("/")
64
64
  end
65
65
  it "should set the path" do
66
- MyExampleModel.path.should eq("/test/example")
67
- MyDefaultModel.path.should eq("/resource")
66
+ expect(MyExampleModel.path).to eq("/test/example")
67
+ expect(MyDefaultModel.path).to eq("/resource")
68
68
  end
69
69
  describe "finders" do
70
70
  before(:each) do
@@ -72,11 +72,11 @@ describe Base, "Base model" do
72
72
  stub_api_get("/test/example", 'base.json')
73
73
  end
74
74
  it "should get all results" do
75
- MyExampleModel.get.length.should == 2
75
+ expect(MyExampleModel.get.length).to eq(2)
76
76
  end
77
77
  it "should get first result" do
78
- MyExampleModel.first.Id.should == 1
79
- MyExampleModel.first.Id.should eq(MyExampleModel.first.id)
78
+ expect(MyExampleModel.first.Id).to eq(1)
79
+ expect(MyExampleModel.first.Id).to eq(MyExampleModel.first.id)
80
80
  end
81
81
  end
82
82
  end
@@ -89,71 +89,71 @@ describe Base, "Base model" do
89
89
  end
90
90
 
91
91
  it "should access existing attributes" do
92
- @model.Name.should == 'My Example'
92
+ expect(@model.Name).to eq('My Example')
93
93
  end
94
94
 
95
95
  it "should raise errors on access to non-existant attributes" do
96
- lambda { @model.Nonsense }.should raise_error(NoMethodError)
96
+ expect { @model.Nonsense }.to raise_error(NoMethodError)
97
97
  end
98
98
 
99
99
  it "should set existing attributes" do
100
100
  new_name = 'John Jacob Jingleheimerschmidt'
101
101
  @model.Name = new_name
102
- @model.Name.should == new_name
102
+ expect(@model.Name).to eq(new_name)
103
103
  end
104
104
 
105
105
  it "should set non-existant attributes" do
106
106
  nonsense = 'nonsense'
107
107
  @model.Nonsense = nonsense
108
- @model.Nonsense.should == nonsense
108
+ expect(@model.Nonsense).to eq(nonsense)
109
109
  end
110
110
 
111
111
  it "should return a boolean for a predicate for an existing attribute" do
112
- @model.Name?.should satisfy { |p| [true, false].include?(p) }
112
+ expect(@model.Name?).to satisfy { |p| [true, false].include?(p) }
113
113
  end
114
114
 
115
115
  it "should return a boolean for whether or not a model is persisted through the api" do
116
- @model.persisted?.should satisfy { |p| [true, false].include?(p) }
116
+ expect(@model.persisted?).to satisfy { |p| [true, false].include?(p) }
117
117
  end
118
118
 
119
119
  it "should raise an Error for a predicate for a non-existant attribute" do
120
- lambda { @model.Nonsense? }.should raise_error(NoMethodError)
120
+ expect { @model.Nonsense? }.to raise_error(NoMethodError)
121
121
  end
122
122
 
123
123
  it "should repond_to existing attributes" do
124
- @model.should respond_to(:Name)
124
+ expect(@model).to respond_to(:Name)
125
125
  end
126
126
 
127
127
  it "should not respond_to non-existant attributes" do
128
- @model.should_not respond_to(:Nonsense)
128
+ expect(@model).not_to respond_to(:Nonsense)
129
129
  end
130
130
 
131
131
  it "should respond_to a setter for an existing attribute" do
132
- @model.should respond_to(:Name=)
132
+ expect(@model).to respond_to(:Name=)
133
133
  end
134
134
 
135
135
  it "should respond_to a setter for a non-existant attribute" do
136
- @model.should respond_to(:Nonsense=)
136
+ expect(@model).to respond_to(:Nonsense=)
137
137
  end
138
138
 
139
139
  it "should respond_to a predicate for an existing attribute" do
140
- @model.should respond_to(:Name?)
140
+ expect(@model).to respond_to(:Name?)
141
141
  end
142
142
 
143
143
  it "should not respond_to a predicate for a non-existant attribute" do
144
- @model.should_not respond_to(:Nonsense?)
144
+ expect(@model).not_to respond_to(:Nonsense?)
145
145
  end
146
146
 
147
147
  it "should respond_to methods inherited from parent classes" do
148
- @model.should respond_to(:freeze)
148
+ expect(@model).to respond_to(:freeze)
149
149
  end
150
150
 
151
151
  it "should respond_to a will_change! method for an existing attribute" do
152
- @model.should respond_to(:Name_will_change!)
152
+ expect(@model).to respond_to(:Name_will_change!)
153
153
  end
154
154
 
155
155
  it "should not respond_to a will_change! method for a non-existant attribute" do
156
- @model.should_not respond_to(:Nonsense_will_change!)
156
+ expect(@model).not_to respond_to(:Nonsense_will_change!)
157
157
  end
158
158
 
159
159
  end
@@ -161,7 +161,7 @@ describe Base, "Base model" do
161
161
  describe "to_partial_path" do
162
162
  it "should return the partial path" do
163
163
  model = MyExampleModel.new()
164
- model.to_partial_path.should eq("my_example_models/my_example_model")
164
+ expect(model.to_partial_path).to eq("my_example_models/my_example_model")
165
165
  end
166
166
  end
167
167
 
@@ -17,7 +17,7 @@ describe Concerns::Destroyable, "Destroyable Concern" do
17
17
  describe 'destroyed?' do
18
18
 
19
19
  it "should not be destroyed" do
20
- @model.destroyed?.should eq(false)
20
+ expect(@model.destroyed?).to eq(false)
21
21
  end
22
22
  end
23
23
 
@@ -27,7 +27,7 @@ describe Concerns::Destroyable, "Destroyable Concern" do
27
27
  stub_api_delete("/some/place/20101230223226074201000000")
28
28
  @model = MyExampleModel.first
29
29
  @model.destroy
30
- @model.destroyed?.should eq(true)
30
+ expect(@model.destroyed?).to eq(true)
31
31
  end
32
32
 
33
33
  end
@@ -31,9 +31,9 @@ describe Concerns::Savable, "Model" do
31
31
  it "should be creatable" do
32
32
  @model = MyExampleModel.new({ :Name => "my name" })
33
33
  s = stub_api_post("/test/example", { :MyExampleModels => [ @model.attributes ] }, "base.json")
34
- @model.save.should eq(true)
35
- @model.persisted?.should eq(true)
36
- s.should have_been_requested
34
+ expect(@model.save).to eq(true)
35
+ expect(@model.persisted?).to eq(true)
36
+ expect(s).to have_been_requested
37
37
  end
38
38
 
39
39
  it "should be updatable" do
@@ -41,37 +41,37 @@ describe Concerns::Savable, "Model" do
41
41
  @model = MyExampleModel.first
42
42
  @model.Name = "new name"
43
43
  s = stub_api_put("/some/place/20101230223226074201000000", @model.dirty_attributes)
44
- @model.save.should eq(true)
45
- @model.persisted?.should eq(true)
46
- s.should have_been_requested
44
+ expect(@model.save).to eq(true)
45
+ expect(@model.persisted?).to eq(true)
46
+ expect(s).to have_been_requested
47
47
  end
48
48
 
49
49
  it "should allow the pluralize method to be overriden" do
50
50
  @model = MyOtherExampleModel.new({ :Name => "my name" })
51
51
  s = stub_api_post("/test/example", { :MyOtherExampleModelThatIsPluralized => [ @model.attributes ] }, "base.json")
52
- @model.save.should eq(true)
53
- @model.persisted?.should eq(true)
54
- s.should have_been_requested
52
+ expect(@model.save).to eq(true)
53
+ expect(@model.persisted?).to eq(true)
54
+ expect(s).to have_been_requested
55
55
  end
56
56
 
57
57
  it "should not pluralize the resource if it already is" do
58
58
  @model = MyPluralizedModels.new({ :Name => "my name" })
59
59
  s = stub_api_post("/test/example", { :MyPluralizedModels => [ @model.attributes ] }, "base.json")
60
- @model.save.should eq(true)
61
- @model.persisted?.should eq(true)
62
- s.should have_been_requested
60
+ expect(@model.save).to eq(true)
61
+ expect(@model.persisted?).to eq(true)
62
+ expect(s).to have_been_requested
63
63
  end
64
64
 
65
65
  it "merges any attributes that come back in the response" do
66
66
  @model = MyExampleModel.new({ :Name => "my name" })
67
67
  s = stub_api_post("/test/example", { :MyExampleModels => [ @model.attributes ] }, "base.json")
68
- @model.save.should eq(true)
69
- @model.persisted?.should eq(true)
70
- @model.Id.should eq(1)
71
- @model.ResourceUri.should eq("/v1/some/place/20101230223226074201000000")
72
- @model.Name.should eq("My Example")
73
- @model.Test.should eq(true)
74
- s.should have_been_requested
68
+ expect(@model.save).to eq(true)
69
+ expect(@model.persisted?).to eq(true)
70
+ expect(@model.Id).to eq(1)
71
+ expect(@model.ResourceUri).to eq("/v1/some/place/20101230223226074201000000")
72
+ expect(@model.Name).to eq("My Example")
73
+ expect(@model.Test).to eq(true)
74
+ expect(s).to have_been_requested
75
75
  end
76
76
 
77
77
  describe "update_attributes" do
@@ -3,7 +3,7 @@ require './spec/spec_helper'
3
3
  describe Connect do
4
4
 
5
5
  it "should respond to prefs" do
6
- Connect.should respond_to(:prefs)
6
+ expect(Connect).to respond_to(:prefs)
7
7
  end
8
8
 
9
9
  end
@@ -13,7 +13,7 @@ describe Constraint do
13
13
  end
14
14
 
15
15
  it "should print to string" do
16
- subject.to_s.should eq("MaxValue: Field(ListPrice,1.0) Value(1000000.0,1000001.0)")
16
+ expect(subject.to_s).to eq("MaxValue: Field(ListPrice,1.0) Value(1000000.0,1000001.0)")
17
17
  end
18
18
 
19
19
  end
@@ -6,8 +6,8 @@ describe Contact do
6
6
  end
7
7
 
8
8
  it "should include the finders module" do
9
- Contact.should respond_to(:find)
10
- Contact.should respond_to(:my)
9
+ expect(Contact).to respond_to(:find)
10
+ expect(Contact).to respond_to(:my)
11
11
  end
12
12
 
13
13
  context "/contacts", :support do
@@ -15,9 +15,9 @@ describe Contact do
15
15
  on_get_it "should get all my contacts" do
16
16
  stub_api_get("/contacts", 'contacts/contacts.json')
17
17
  contacts = Contact.get
18
- contacts.should be_an(Array)
19
- contacts.length.should eq(3)
20
- contacts.first.Id.should eq("20101230223226074201000000")
18
+ expect(contacts).to be_an(Array)
19
+ expect(contacts.length).to eq(3)
20
+ expect(contacts.first.Id).to eq("20101230223226074201000000")
21
21
  end
22
22
 
23
23
  on_post_it "should save a new contact" do
@@ -25,8 +25,8 @@ describe Contact do
25
25
  c=Contact.new
26
26
  c.DisplayName = "Contact Four"
27
27
  c.PrimaryEmail = "contact4@fbsdata.com"
28
- c.save.should be(true)
29
- c.Id.should eq('20101230223226074204000000')
28
+ expect(c.save).to be(true)
29
+ expect(c.Id).to eq('20101230223226074204000000')
30
30
  end
31
31
 
32
32
  on_post_it "should save a new contact and notify" do
@@ -35,9 +35,9 @@ describe Contact do
35
35
  c.notify = true
36
36
  c.attributes["DisplayName"] = "Contact Four"
37
37
  c.attributes["PrimaryEmail"] = "contact4@fbsdata.com"
38
- c.save.should be(true)
39
- c.Id.should eq('20101230223226074204000000')
40
- c.ResourceUri.should eq('/v1/contacts/20101230223226074204000000')
38
+ expect(c.save).to be(true)
39
+ expect(c.Id).to eq('20101230223226074204000000')
40
+ expect(c.ResourceUri).to eq('/v1/contacts/20101230223226074204000000')
41
41
  end
42
42
 
43
43
  on_post_it "should fail saving" do
@@ -46,8 +46,8 @@ describe Contact do
46
46
  end
47
47
 
48
48
  c=Contact.new
49
- c.save.should be(false)
50
- expect{ c.save! }.to raise_error(SparkApi::ClientError){ |e| e.status.should == 400 }
49
+ expect(c.save).to be(false)
50
+ expect{ c.save! }.to raise_error(SparkApi::ClientError){ |e| expect(e.status).to eq(400) }
51
51
  end
52
52
 
53
53
  on_post_it "should fail saving and set @errors" do
@@ -56,10 +56,10 @@ describe Contact do
56
56
  end
57
57
 
58
58
  c=Contact.new
59
- c.errors.length.should eq(0)
60
- c.save.should be_false
61
- c.errors.length.should eq(1)
62
- c.errors.first[:code].should eq(1055)
59
+ expect(c.errors.length).to eq(0)
60
+ expect(c.save).to be false
61
+ expect(c.errors.length).to eq(1)
62
+ expect(c.errors.first[:code]).to eq(1055)
63
63
  end
64
64
 
65
65
  context "on an epic fail" do
@@ -69,8 +69,8 @@ describe Contact do
69
69
  end
70
70
 
71
71
  c=Contact.new()
72
- expect{ c.save! }.to raise_error(SparkApi::ClientError){ |e| e.status.should == 500 }
73
- expect{ c.save }.to raise_error(SparkApi::ClientError){ |e| e.status.should == 500 }
72
+ expect{ c.save! }.to raise_error(SparkApi::ClientError){ |e| expect(e.status).to eq(500) }
73
+ expect{ c.save }.to raise_error(SparkApi::ClientError){ |e| expect(e.status).to eq(500) }
74
74
  end
75
75
  end
76
76
 
@@ -78,9 +78,9 @@ describe Contact do
78
78
  on_get_it "should get all my Tags" do
79
79
  stub_api_get("/contacts/tags", 'contacts/tags.json')
80
80
  tags = Contact.tags
81
- tags.should be_an(Array)
82
- tags.length.should eq(4)
83
- tags.first["Tag"].should eq("Current Buyers")
81
+ expect(tags).to be_an(Array)
82
+ expect(tags.length).to eq(4)
83
+ expect(tags.first["Tag"]).to eq("Current Buyers")
84
84
  end
85
85
  end
86
86
 
@@ -88,30 +88,30 @@ describe Contact do
88
88
  on_get_it "should get all contacts with Tag <tag_name>" do
89
89
  stub_api_get("/contacts/tags/IDX%20Lead", 'contacts/contacts.json')
90
90
  contacts = Contact.by_tag("IDX Lead")
91
- contacts.should be_an(Array)
92
- contacts.length.should eq(3)
93
- contacts.first.Id.should eq("20101230223226074201000000")
94
- contacts.first.Tags[0].should eq("IDX Lead")
91
+ expect(contacts).to be_an(Array)
92
+ expect(contacts.length).to eq(3)
93
+ expect(contacts.first.Id).to eq("20101230223226074201000000")
94
+ expect(contacts.first.Tags[0]).to eq("IDX Lead")
95
95
  end
96
96
  end
97
97
 
98
98
  context "/export", :support do
99
99
  on_get_it "should get all contacts belonging to the current user" do
100
100
  stub_api_get("/contacts/export", 'contacts/contacts.json')
101
- Contact.should respond_to(:export)
101
+ expect(Contact).to respond_to(:export)
102
102
  contacts = Contact.export
103
- contacts.should be_an(Array)
104
- contacts.length.should eq(3)
103
+ expect(contacts).to be_an(Array)
104
+ expect(contacts.length).to eq(3)
105
105
  end
106
106
  end
107
107
 
108
108
  context "/export/all", :support do
109
109
  on_get_it "should get all contacts belonging to the current user" do
110
110
  stub_api_get("/contacts/export/all", 'contacts/contacts.json')
111
- Contact.should respond_to(:export_all)
111
+ expect(Contact).to respond_to(:export_all)
112
112
  contacts = Contact.export_all
113
- contacts.should be_an(Array)
114
- contacts.length.should eq(3)
113
+ expect(contacts).to be_an(Array)
114
+ expect(contacts.length).to eq(3)
115
115
  end
116
116
  end
117
117
 
@@ -131,8 +131,8 @@ describe Contact do
131
131
  on_get_it "should get all the saved searches belonging to the customer" do
132
132
  stub_api_get("/contacts/#{contact.Id}/savedsearches", 'saved_searches/get.json')
133
133
  saved_searches = contact.saved_searches
134
- saved_searches.should be_an(Array)
135
- saved_searches.length.should eq(2)
134
+ expect(saved_searches).to be_an(Array)
135
+ expect(saved_searches.length).to eq(2)
136
136
  end
137
137
 
138
138
  it "should pass any arguments as parameters" do
@@ -152,8 +152,8 @@ describe Contact do
152
152
  on_get_it "should get all the provided searches belonging to the customer" do
153
153
  stub_api_get("/contacts/#{contact.Id}/provided/savedsearches", 'saved_searches/get.json')
154
154
  saved_searches = contact.provided_searches
155
- saved_searches.should be_an(Array)
156
- saved_searches.length.should eq(2)
155
+ expect(saved_searches).to be_an(Array)
156
+ expect(saved_searches.length).to eq(2)
157
157
  end
158
158
 
159
159
  it "should pass any arguments as parameters" do
@@ -173,8 +173,8 @@ describe Contact do
173
173
  on_get_it "should get all the listing carts belonging to the customer" do
174
174
  stub_api_get("/contacts/#{contact.Id}/listingcarts", 'listing_carts/listing_cart.json')
175
175
  listing_carts = contact.listing_carts
176
- listing_carts.should be_an(Array)
177
- listing_carts.length.should eq(2)
176
+ expect(listing_carts).to be_an(Array)
177
+ expect(listing_carts.length).to eq(2)
178
178
  end
179
179
 
180
180
  it "should pass any arguments as parameters" do
@@ -189,7 +189,7 @@ describe Contact do
189
189
  contact = Contact.my
190
190
  stub_api_get("/contacts/#{contact.Id}/portal", 'contacts/vow_accounts/get.json')
191
191
  vow_account = contact.vow_account
192
- vow_account.persisted?.should be_true
192
+ expect(vow_account.persisted?).to be true
193
193
  end
194
194
  end
195
195
 
@@ -198,17 +198,17 @@ describe Contact do
198
198
  it "should get all of a contact's comments" do
199
199
  s = stub_api_get("/contacts/#{contact_id}/comments", "comments/get.json")
200
200
  comments = Contact.new(:Id => contact_id).comments
201
- comments.size.should eq(2)
202
- s.should have_been_requested
201
+ expect(comments.size).to eq(2)
202
+ expect(s).to have_been_requested
203
203
  end
204
204
 
205
205
  it "should create a new contact comment" do
206
206
  s = stub_api_post("/contacts/#{contact_id}/comments", "comments/new.json", "comments/post.json")
207
207
  comment = Comment.new(:Comment => "This is a comment.")
208
208
  comment.parent = Contact.new(:Id => contact_id)
209
- comment.save.should be(true)
210
- comment.Id.should eq("20121114100201798092000005")
211
- s.should have_been_requested
209
+ expect(comment.save).to be(true)
210
+ expect(comment.Id).to eq("20121114100201798092000005")
211
+ expect(s).to have_been_requested
212
212
  end
213
213
 
214
214
  it "should create a new contact comment using helper method" do
@@ -216,8 +216,8 @@ describe Contact do
216
216
  s = stub_api_post("/contacts/#{contact_id}/comments", "comments/new.json", "comments/post.json")
217
217
  contact = Contact.my
218
218
  comment = contact.comment "This is a comment."
219
- comment.should be_a(Comment)
220
- s.should have_been_requested
219
+ expect(comment).to be_a(Comment)
220
+ expect(s).to have_been_requested
221
221
  end
222
222
 
223
223
  end
@@ -230,8 +230,8 @@ describe Contact do
230
230
  stub_api_get("/contacts/#{contact_id}/comments", "comments/get.json")
231
231
  s = stub_api_delete("/activities/20121128132106172132000004/comments/#{id}", "success.json")
232
232
  comment = Contact.new(:Id => contact_id).comments.first
233
- comment.destroy.should eq(true)
234
- s.should have_been_requested
233
+ expect(comment.destroy).to eq(true)
234
+ expect(s).to have_been_requested
235
235
  end
236
236
 
237
237
  end
@@ -242,9 +242,9 @@ describe Contact do
242
242
  on_get_it "should get a single contact when using #my" do
243
243
  stub_api_get("/my/contact", 'contacts/my.json')
244
244
  contact = Contact.my
245
- contact.should be_a(Contact)
246
- contact.Id.should == '20090928182824338901000000'
247
- contact.DisplayName.should == 'BH FOO'
245
+ expect(contact).to be_a(Contact)
246
+ expect(contact.Id).to eq('20090928182824338901000000')
247
+ expect(contact.DisplayName).to eq('BH FOO')
248
248
  end
249
249
  end
250
250