bookingsync-api 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +11 -11
- data/Guardfile +1 -1
- data/README.md +1 -0
- data/Rakefile +13 -3
- data/bookingsync-api.gemspec +3 -3
- data/lib/bookingsync-api.rb +1 -1
- data/lib/bookingsync/api/client.rb +7 -4
- data/lib/bookingsync/api/client/booking_comments.rb +1 -1
- data/lib/bookingsync/api/client/living_rooms.rb +65 -0
- data/lib/bookingsync/api/error.rb +1 -1
- data/lib/bookingsync/api/middleware/logger.rb +6 -6
- data/lib/bookingsync/api/resource.rb +1 -1
- data/lib/bookingsync/api/response.rb +2 -2
- data/lib/bookingsync/api/serializer.rb +5 -5
- data/lib/bookingsync/api/version.rb +1 -1
- data/spec/bookingsync/api/client/bathrooms_spec.rb +10 -9
- data/spec/bookingsync/api/client/bedrooms_spec.rb +10 -9
- data/spec/bookingsync/api/client/bookings_spec.rb +13 -13
- data/spec/bookingsync/api/client/clients_spec.rb +13 -11
- data/spec/bookingsync/api/client/fees_spec.rb +2 -2
- data/spec/bookingsync/api/client/inquiries_spec.rb +12 -10
- data/spec/bookingsync/api/client/living_rooms_spec.rb +62 -0
- data/spec/bookingsync/api/client/nightly_rate_maps_spec.rb +1 -1
- data/spec/bookingsync/api/client/payments_spec.rb +8 -11
- data/spec/bookingsync/api/client/periods_spec.rb +5 -5
- data/spec/bookingsync/api/client/photos_spec.rb +6 -6
- data/spec/bookingsync/api/client/preferences_general_settings_spec.rb +1 -1
- data/spec/bookingsync/api/client/preferences_payments_spec.rb +0 -1
- data/spec/bookingsync/api/client/rates_rules_spec.rb +3 -4
- data/spec/bookingsync/api/client/rates_tables_spec.rb +4 -5
- data/spec/bookingsync/api/client/rental_agreements_spec.rb +5 -5
- data/spec/bookingsync/api/client/rentals_amenities_spec.rb +4 -4
- data/spec/bookingsync/api/client/rentals_fees_spec.rb +1 -1
- data/spec/bookingsync/api/client/rentals_spec.rb +7 -10
- data/spec/bookingsync/api/client/reviews_spec.rb +3 -6
- data/spec/bookingsync/api/client/seasons_spec.rb +4 -9
- data/spec/bookingsync/api/client/sources_spec.rb +4 -5
- data/spec/bookingsync/api/client/special_offers_spec.rb +6 -6
- data/spec/bookingsync/api/client/strict_bookings_spec.rb +8 -8
- data/spec/bookingsync/api/client_spec.rb +29 -15
- data/spec/bookingsync/api/error_spec.rb +3 -3
- data/spec/bookingsync/api/relation_spec.rb +8 -6
- data/spec/bookingsync/api/resource_spec.rb +29 -26
- data/spec/bookingsync/api/response_spec.rb +16 -15
- data/spec/fixtures/cassettes/BookingSync_API_Client_LivingRooms/_cancel_living_room/cancels_given_living_room.yml +69 -0
- data/spec/fixtures/cassettes/BookingSync_API_Client_LivingRooms/_create_living_room/creates_a_new_living_room.yml +82 -0
- data/spec/fixtures/cassettes/BookingSync_API_Client_LivingRooms/_edit_living_room/updates_given_living_room_by_ID.yml +75 -0
- data/spec/fixtures/cassettes/BookingSync_API_Client_LivingRooms/_living_room/returns_a_single_living_room.yml +84 -0
- data/spec/fixtures/cassettes/BookingSync_API_Client_LivingRooms/_living_rooms/returns_living_rooms.yml +84 -0
- data/spec/spec_helper.rb +12 -12
- metadata +29 -3
@@ -18,23 +18,25 @@ describe BookingSync::API::Client::Clients do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe ".create_client", :vcr do
|
21
|
-
let(:attributes)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
let(:attributes) do
|
22
|
+
{
|
23
|
+
fullname: "John Smith",
|
24
|
+
emails: [{ label: "default", email: "smith@example.com" }],
|
25
|
+
country_code: "IT",
|
26
|
+
city: "Rome"
|
27
|
+
}
|
28
|
+
end
|
27
29
|
|
28
30
|
it "creates a new client" do
|
29
31
|
api.create_client(attributes)
|
30
32
|
assert_requested :post, bs_url("clients"),
|
31
|
-
body: {clients: [attributes]}.to_json
|
33
|
+
body: { clients: [attributes] }.to_json
|
32
34
|
end
|
33
35
|
|
34
36
|
it "returns newly created client" do
|
35
|
-
VCR.use_cassette(
|
37
|
+
VCR.use_cassette("BookingSync_API_Client_Clients/_create_client/creates_a_new_client") do
|
36
38
|
client = api.create_client(attributes)
|
37
|
-
expect(client.emails).to eq [{:
|
39
|
+
expect(client.emails).to eq [{ label: "default", email: "smith@example.com" }]
|
38
40
|
expect(client.fullname).to eq ("John Smith")
|
39
41
|
end
|
40
42
|
end
|
@@ -44,11 +46,11 @@ describe BookingSync::API::Client::Clients do
|
|
44
46
|
it "updates given client by ID" do
|
45
47
|
api.edit_client(77703, fullname: "Gary Smith")
|
46
48
|
assert_requested :put, bs_url("clients/77703"),
|
47
|
-
body: {clients: [{fullname: "Gary Smith"}]}.to_json
|
49
|
+
body: { clients: [{ fullname: "Gary Smith" }] }.to_json
|
48
50
|
end
|
49
51
|
|
50
52
|
it "returns updated client" do
|
51
|
-
VCR.use_cassette(
|
53
|
+
VCR.use_cassette("BookingSync_API_Client_Clients/_edit_client/updates_given_client_by_ID") do
|
52
54
|
client = api.edit_client(77703, fullname: "Gary Smith")
|
53
55
|
expect(client).to be_kind_of(BookingSync::API::Resource)
|
54
56
|
expect(client.fullname).to eq("Gary Smith")
|
@@ -34,9 +34,9 @@ describe BookingSync::API::Client::Fees do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
it "returns newly created fee" do
|
37
|
-
VCR.use_cassette(
|
37
|
+
VCR.use_cassette("BookingSync_API_Client_Fees/_create_fee/creates_a_new_fee") do
|
38
38
|
fee = client.create_fee(attributes)
|
39
|
-
expect(fee.name).to eq(
|
39
|
+
expect(fee.name).to eq(en: "New fee")
|
40
40
|
expect(fee.rate).to eq "10.0"
|
41
41
|
expect(fee.rate_kind).to eq "fixed"
|
42
42
|
expect(fee.downpayment_percentage).to eq "10.0"
|
@@ -18,24 +18,26 @@ describe BookingSync::API::Client::Inquiries do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe ".create_inquiry", :vcr do
|
21
|
-
let(:attributes)
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
let(:attributes) do
|
22
|
+
{
|
23
|
+
rental_id: 7,
|
24
|
+
start_at: Time.now,
|
25
|
+
end_at: Time.now + 86400, # one day
|
26
|
+
firstname: "John",
|
27
|
+
lastname: "Smith",
|
28
|
+
email: "john@example.com"
|
29
|
+
}
|
30
|
+
end
|
29
31
|
let(:rental) { BookingSync::API::Resource.new(client, id: 7) }
|
30
32
|
|
31
33
|
it "creates a new inquiry" do
|
32
34
|
client.create_inquiry(rental, attributes)
|
33
35
|
assert_requested :post, bs_url("rentals/7/inquiries"),
|
34
|
-
body: {inquiries: [attributes]}.to_json
|
36
|
+
body: { inquiries: [attributes] }.to_json
|
35
37
|
end
|
36
38
|
|
37
39
|
it "returns newly created inquiry" do
|
38
|
-
VCR.use_cassette(
|
40
|
+
VCR.use_cassette("BookingSync_API_Client_Inquiries/_create_inquiry/creates_a_new_inquiry") do
|
39
41
|
inquiry = client.create_inquiry(rental, attributes)
|
40
42
|
expect(inquiry.rental_id).to eql(7)
|
41
43
|
expect(inquiry.firstname).to eql("John")
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe BookingSync::API::Client::LivingRooms do
|
4
|
+
let(:client) { BookingSync::API::Client.new(test_access_token) }
|
5
|
+
|
6
|
+
describe ".living_rooms", :vcr do
|
7
|
+
it "returns living_rooms" do
|
8
|
+
expect(client.living_rooms).not_to be_empty
|
9
|
+
assert_requested :get, bs_url("living_rooms")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
describe ".living_room", :vcr do
|
14
|
+
it "returns a single living_room" do
|
15
|
+
living_room = client.living_room(6)
|
16
|
+
expect(living_room.id).to eq 6
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe ".create_living_room", :vcr do
|
21
|
+
let(:attributes) { { sofa_beds_count: 2 } }
|
22
|
+
let(:rental) { BookingSync::API::Resource.new(client, id: 3) }
|
23
|
+
|
24
|
+
it "creates a new living_room" do
|
25
|
+
client.create_living_room(rental, attributes)
|
26
|
+
assert_requested :post, bs_url("rentals/3/living_rooms"),
|
27
|
+
body: { living_rooms: [attributes] }.to_json
|
28
|
+
end
|
29
|
+
|
30
|
+
it "returns newly created living_room" do
|
31
|
+
VCR.use_cassette("BookingSync_API_Client_LivingRooms/_create_living_room/creates_a_new_living_room") do
|
32
|
+
living_room = client.create_living_room(rental, attributes)
|
33
|
+
expect(living_room.sofa_beds_count).to eq(attributes[:sofa_beds_count])
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe ".edit_living_room", :vcr do
|
39
|
+
let(:attributes) { { sofa_beds_count: 3 } }
|
40
|
+
|
41
|
+
it "updates given living_room by ID" do
|
42
|
+
client.edit_living_room(6, attributes)
|
43
|
+
assert_requested :put, bs_url("living_rooms/6"),
|
44
|
+
body: { living_rooms: [attributes] }.to_json
|
45
|
+
end
|
46
|
+
|
47
|
+
it "returns updated living_room" do
|
48
|
+
VCR.use_cassette("BookingSync_API_Client_LivingRooms/_edit_living_room/updates_given_living_room_by_ID") do
|
49
|
+
living_room = client.edit_living_room(6, attributes)
|
50
|
+
expect(living_room).to be_kind_of(BookingSync::API::Resource)
|
51
|
+
expect(living_room.sofa_beds_count).to eq(attributes[:sofa_beds_count])
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe ".cancel_living_room", :vcr do
|
57
|
+
it "cancels given living_room" do
|
58
|
+
client.cancel_living_room(6)
|
59
|
+
assert_requested :delete, bs_url("living_rooms/6")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -27,7 +27,7 @@ describe BookingSync::API::Client::NightlyRateMaps do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
it "returns updated nightly_rate_map" do
|
30
|
-
VCR.use_cassette(
|
30
|
+
VCR.use_cassette("BookingSync_API_Client_NightlyRateMaps/_edit_nightly_rate_map/updates_given_nightly_rate_map_by_ID") do
|
31
31
|
nightly_rate_map = client.edit_nightly_rate_map(2, attributes)
|
32
32
|
expect(nightly_rate_map).to be_kind_of(BookingSync::API::Resource)
|
33
33
|
expect(nightly_rate_map.rates_map).to eq attributes[:rates_map]
|
@@ -18,19 +18,16 @@ describe BookingSync::API::Client::Payments do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe ".create_payment", :vcr do
|
21
|
-
let(:attributes) {{
|
22
|
-
amount: 200,
|
23
|
-
kind: 'cash'
|
24
|
-
}}
|
21
|
+
let(:attributes) { { amount: 200, kind: "cash" } }
|
25
22
|
|
26
23
|
it "creates a new payment" do
|
27
24
|
api.create_payment(1, attributes)
|
28
25
|
assert_requested :post, bs_url("payments"),
|
29
|
-
body: { booking_id: 1, payments: [attributes]}.to_json
|
26
|
+
body: { booking_id: 1, payments: [attributes] }.to_json
|
30
27
|
end
|
31
28
|
|
32
29
|
it "returns newly created payment" do
|
33
|
-
VCR.use_cassette(
|
30
|
+
VCR.use_cassette("BookingSync_API_Client_Payments/_create_payment/creates_a_new_payment") do
|
34
31
|
payment = api.create_payment(1, attributes)
|
35
32
|
expect(payment.amount).to eql(200)
|
36
33
|
expect(payment.kind).to eql("cash")
|
@@ -40,16 +37,16 @@ describe BookingSync::API::Client::Payments do
|
|
40
37
|
|
41
38
|
describe ".edit_payment", :vcr do
|
42
39
|
it "updates given payment by ID" do
|
43
|
-
api.edit_payment(2, kind:
|
40
|
+
api.edit_payment(2, kind: "cash")
|
44
41
|
assert_requested :put, bs_url("payments/2"),
|
45
|
-
body: {payments: [{kind:
|
42
|
+
body: { payments: [{ kind: "cash" }] }.to_json
|
46
43
|
end
|
47
44
|
|
48
45
|
it "returns updated payment" do
|
49
|
-
VCR.use_cassette(
|
50
|
-
payment = api.edit_payment(2, kind:
|
46
|
+
VCR.use_cassette("BookingSync_API_Client_Payments/_edit_payment/updates_given_payment_by_ID") do
|
47
|
+
payment = api.edit_payment(2, kind: "cash")
|
51
48
|
expect(payment).to be_kind_of(BookingSync::API::Resource)
|
52
|
-
expect(payment.kind).to eq(
|
49
|
+
expect(payment.kind).to eq("cash")
|
53
50
|
end
|
54
51
|
end
|
55
52
|
end
|
@@ -18,17 +18,17 @@ describe BookingSync::API::Client::Periods do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe ".create_period", :vcr do
|
21
|
-
let(:attributes) { {start_at: "2013-04-10", end_at: "2013-04-22"} }
|
21
|
+
let(:attributes) { { start_at: "2013-04-10", end_at: "2013-04-22" } }
|
22
22
|
let(:season) { BookingSync::API::Resource.new(client, id: 9) }
|
23
23
|
|
24
24
|
it "creates a new period" do
|
25
25
|
client.create_period(season, attributes)
|
26
26
|
assert_requested :post, bs_url("seasons/9/periods"),
|
27
|
-
body: {periods: [attributes]}.to_json
|
27
|
+
body: { periods: [attributes] }.to_json
|
28
28
|
end
|
29
29
|
|
30
30
|
it "returns newly created period" do
|
31
|
-
VCR.use_cassette(
|
31
|
+
VCR.use_cassette("BookingSync_API_Client_Periods/_create_period/creates_a_new_period") do
|
32
32
|
period = client.create_period(season, attributes)
|
33
33
|
expect(period.start_at).to eql(Time.parse(attributes[:start_at]))
|
34
34
|
expect(period.end_at).to eql(Time.parse(attributes[:end_at]))
|
@@ -37,7 +37,7 @@ describe BookingSync::API::Client::Periods do
|
|
37
37
|
end
|
38
38
|
|
39
39
|
describe ".edit_period", :vcr do
|
40
|
-
let(:attributes) { {end_at:
|
40
|
+
let(:attributes) { { end_at: "2014-07-15" } }
|
41
41
|
|
42
42
|
it "updates given period by ID" do
|
43
43
|
client.edit_period(6, attributes)
|
@@ -46,7 +46,7 @@ describe BookingSync::API::Client::Periods do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it "returns updated period" do
|
49
|
-
VCR.use_cassette(
|
49
|
+
VCR.use_cassette("BookingSync_API_Client_Periods/_edit_period/updates_given_period_by_ID") do
|
50
50
|
period = client.edit_period(6, attributes)
|
51
51
|
expect(period).to be_kind_of(BookingSync::API::Resource)
|
52
52
|
expect(period.end_at).to eq(Time.parse(attributes[:end_at]))
|
@@ -20,14 +20,14 @@ describe BookingSync::API::Client::Photos do
|
|
20
20
|
|
21
21
|
describe ".create_photo", :vcr do
|
22
22
|
let(:attributes) do
|
23
|
-
{photo_path: "spec/fixtures/files/test.jpg",
|
24
|
-
description_en: "Funny", kind: "livingroom"}
|
23
|
+
{ photo_path: "spec/fixtures/files/test.jpg",
|
24
|
+
description_en: "Funny", kind: "livingroom" }
|
25
25
|
end
|
26
26
|
|
27
27
|
it "creates a photo with photo path" do
|
28
28
|
photo = client.create_photo(rental, attributes)
|
29
29
|
assert_requested :post, bs_url("rentals/2/photos"),
|
30
|
-
body: {photos: [attributes]}.to_json
|
30
|
+
body: { photos: [attributes] }.to_json
|
31
31
|
expect(photo.kind).to eq("livingroom")
|
32
32
|
end
|
33
33
|
|
@@ -35,7 +35,7 @@ describe BookingSync::API::Client::Photos do
|
|
35
35
|
encoded = Base64.encode64(File.read("spec/fixtures/files/test.jpg"))
|
36
36
|
photo = client.create_photo(rental, photo: encoded, kind: "livingroom")
|
37
37
|
assert_requested :post, bs_url("rentals/2/photos"),
|
38
|
-
body: {photos: [photo: encoded, kind: "livingroom"]}.to_json
|
38
|
+
body: { photos: [photo: encoded, kind: "livingroom"] }.to_json
|
39
39
|
expect(photo.kind).to eq("livingroom")
|
40
40
|
end
|
41
41
|
|
@@ -44,12 +44,12 @@ describe BookingSync::API::Client::Photos do
|
|
44
44
|
photo = client.create_photo(rental, remote_photo_url: remote_url,
|
45
45
|
kind: "livingroom")
|
46
46
|
assert_requested :post, bs_url("rentals/2/photos"),
|
47
|
-
body: {photos: [remote_photo_url: remote_url, kind: "livingroom"]}.to_json
|
47
|
+
body: { photos: [remote_photo_url: remote_url, kind: "livingroom"] }.to_json
|
48
48
|
expect(photo.kind).to eq("livingroom")
|
49
49
|
end
|
50
50
|
|
51
51
|
it "returns newly created photo" do
|
52
|
-
VCR.use_cassette(
|
52
|
+
VCR.use_cassette("BookingSync_API_Client_Photos/_create_photo/creates_a_photo") do
|
53
53
|
photo = client.create_photo(rental, attributes)
|
54
54
|
expect(photo.kind).to eq("livingroom")
|
55
55
|
expect(photo.description.en).to eq("Funny")
|
@@ -18,7 +18,7 @@ describe BookingSync::API::Client::PreferencesGeneralSettings do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
it "returns updated preferences_general_setting" do
|
21
|
-
VCR.use_cassette(
|
21
|
+
VCR.use_cassette("BookingSync_API_Client_PreferencesGeneralSettings/_edit_preferences_general_setting/updates_given_preferences_general_setting_by_ID") do
|
22
22
|
setting = api.edit_preferences_general_setting(1, selected_locales: ["de"])
|
23
23
|
expect(setting).to be_kind_of(BookingSync::API::Resource)
|
24
24
|
expect(setting.selected_locales).to eq ["en", "de"]
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe BookingSync::API::Client::RatesRules do
|
4
|
-
|
5
4
|
let(:client) { BookingSync::API::Client.new(test_access_token) }
|
6
5
|
|
7
6
|
describe ".rates_rules", :vcr do
|
@@ -37,7 +36,7 @@ describe BookingSync::API::Client::RatesRules do
|
|
37
36
|
end
|
38
37
|
|
39
38
|
it "returns newly created rates_rule" do
|
40
|
-
VCR.use_cassette(
|
39
|
+
VCR.use_cassette("BookingSync_API_Client_RatesRules/_create_rates_rule/creates_a_new_rates_rule") do
|
41
40
|
rates_rule = client.create_rates_rule(rates_table, attributes)
|
42
41
|
expect(rates_rule.start_date).to eql(Time.parse(attributes[:start_date]))
|
43
42
|
expect(rates_rule.end_date).to eql(Time.parse(attributes[:end_date]))
|
@@ -46,7 +45,7 @@ describe BookingSync::API::Client::RatesRules do
|
|
46
45
|
end
|
47
46
|
|
48
47
|
describe ".edit_rates_rule", :vcr do
|
49
|
-
let(:attributes) { { end_date:
|
48
|
+
let(:attributes) { { end_date: "2014-07-15" } }
|
50
49
|
|
51
50
|
it "updates given rates_rule by ID" do
|
52
51
|
client.edit_rates_rule(252, attributes)
|
@@ -55,7 +54,7 @@ describe BookingSync::API::Client::RatesRules do
|
|
55
54
|
end
|
56
55
|
|
57
56
|
it "returns updated rates_rule" do
|
58
|
-
VCR.use_cassette(
|
57
|
+
VCR.use_cassette("BookingSync_API_Client_RatesRules/_edit_rates_rule/updates_given_rates_rule_by_ID") do
|
59
58
|
rates_rule = client.edit_rates_rule(252, attributes)
|
60
59
|
expect(rates_rule).to be_kind_of(BookingSync::API::Resource)
|
61
60
|
expect(rates_rule.end_date).to eq(Time.parse(attributes[:end_date]))
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe BookingSync::API::Client::RatesTables do
|
4
|
-
|
5
4
|
let(:client) { BookingSync::API::Client.new(test_access_token) }
|
6
5
|
|
7
6
|
describe ".rates_tables", :vcr do
|
@@ -20,7 +19,7 @@ describe BookingSync::API::Client::RatesTables do
|
|
20
19
|
|
21
20
|
describe ".create_rates_table", :vcr do
|
22
21
|
let(:attributes) {
|
23
|
-
{ name:
|
22
|
+
{ name: "New rate table" }
|
24
23
|
}
|
25
24
|
|
26
25
|
it "creates a new rates_table" do
|
@@ -30,7 +29,7 @@ describe BookingSync::API::Client::RatesTables do
|
|
30
29
|
end
|
31
30
|
|
32
31
|
it "returns newly created rates_table" do
|
33
|
-
VCR.use_cassette(
|
32
|
+
VCR.use_cassette("BookingSync_API_Client_RatesTables/_create_rates_table/creates_a_new_rates_table") do
|
34
33
|
rates_table = client.create_rates_table(attributes)
|
35
34
|
expect(rates_table.name).to eql(attributes[:name])
|
36
35
|
end
|
@@ -39,7 +38,7 @@ describe BookingSync::API::Client::RatesTables do
|
|
39
38
|
|
40
39
|
describe ".edit_rates_table", :vcr do
|
41
40
|
let(:attributes) {
|
42
|
-
{ name:
|
41
|
+
{ name: "Updated rate table" }
|
43
42
|
}
|
44
43
|
|
45
44
|
it "updates given rates_table by ID" do
|
@@ -49,7 +48,7 @@ describe BookingSync::API::Client::RatesTables do
|
|
49
48
|
end
|
50
49
|
|
51
50
|
it "returns updated rates_table" do
|
52
|
-
VCR.use_cassette(
|
51
|
+
VCR.use_cassette("BookingSync_API_Client_RatesTables/_edit_rates_table/updates_given_rates_table_by_ID") do
|
53
52
|
rates_table = client.edit_rates_table(11, attributes)
|
54
53
|
expect(rates_table).to be_kind_of(BookingSync::API::Resource)
|
55
54
|
expect(rates_table.name).to eql(attributes[:name])
|
@@ -28,7 +28,7 @@ describe BookingSync::API::Client::RentalAgreements do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
it "returns newly created rental agreement" do
|
31
|
-
VCR.use_cassette(
|
31
|
+
VCR.use_cassette("BookingSync_API_Client_RentalAgreements/_create_rental_agreement/creates_a_new_rental_agreement") do
|
32
32
|
rental_agreement = client.create_rental_agreement(attributes)
|
33
33
|
expect(rental_agreement.body).to eql(attributes[:body])
|
34
34
|
end
|
@@ -41,11 +41,11 @@ describe BookingSync::API::Client::RentalAgreements do
|
|
41
41
|
it "creates a new rental agreement" do
|
42
42
|
client.create_rental_agreement_for_booking(booking, attributes)
|
43
43
|
assert_requested :post, bs_url("bookings/#{booking}/rental_agreements"),
|
44
|
-
body: {rental_agreements: [attributes]}.to_json
|
44
|
+
body: { rental_agreements: [attributes] }.to_json
|
45
45
|
end
|
46
46
|
|
47
47
|
it "returns newly created rental agreement" do
|
48
|
-
VCR.use_cassette(
|
48
|
+
VCR.use_cassette("BookingSync_API_Client_RentalAgreements/_create_rental_agreement_for_booking/creates_a_new_rental_agreement") do
|
49
49
|
rental_agreement = client.create_rental_agreement_for_booking(booking, attributes)
|
50
50
|
expect(rental_agreement.body).to eql(attributes[:body])
|
51
51
|
end
|
@@ -58,11 +58,11 @@ describe BookingSync::API::Client::RentalAgreements do
|
|
58
58
|
it "creates a new rental agreement" do
|
59
59
|
client.create_rental_agreement_for_rental(rental, attributes)
|
60
60
|
assert_requested :post, bs_url("rentals/20/rental_agreements"),
|
61
|
-
body: {rental_agreements: [attributes]}.to_json
|
61
|
+
body: { rental_agreements: [attributes] }.to_json
|
62
62
|
end
|
63
63
|
|
64
64
|
it "returns newly created rental agreement" do
|
65
|
-
VCR.use_cassette(
|
65
|
+
VCR.use_cassette("BookingSync_API_Client_RentalAgreements/_create_rental_agreement_for_rental/creates_a_new_rental_agreement") do
|
66
66
|
rental_agreement = client.create_rental_agreement_for_rental(rental, attributes)
|
67
67
|
expect(rental_agreement.body).to eql(attributes[:body])
|
68
68
|
end
|
@@ -40,9 +40,9 @@ describe BookingSync::API::Client::RentalsAmenities do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it "returns newly created rentals_amenity" do
|
43
|
-
VCR.use_cassette(
|
43
|
+
VCR.use_cassette("BookingSync_API_Client_RentalsAmenities/_create_rentals_amenity/creates_a_new_rentals_amenity") do
|
44
44
|
rentals_amenity = client.create_rentals_amenity(rental, attributes)
|
45
|
-
expect(rentals_amenity.details).to eq(
|
45
|
+
expect(rentals_amenity.details).to eq(en: "Details")
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
@@ -57,10 +57,10 @@ describe BookingSync::API::Client::RentalsAmenities do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it "returns updated rentals_amenity" do
|
60
|
-
VCR.use_cassette(
|
60
|
+
VCR.use_cassette("BookingSync_API_Client_RentalsAmenities/_edit_rentals_amenity/updates_given_rentals_amenity_by_ID") do
|
61
61
|
rentals_amenity = client.edit_rentals_amenity(6159, attributes)
|
62
62
|
expect(rentals_amenity).to be_kind_of(BookingSync::API::Resource)
|
63
|
-
expect(rentals_amenity.details).to eq(
|
63
|
+
expect(rentals_amenity.details).to eq(en: "New Details")
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|