quicktravel_client 3.3.0 → 3.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/quick_travel/property.rb +8 -0
- data/lib/quick_travel/version.rb +1 -1
- data/spec/property_spec.rb +20 -0
- data/spec/support/cassettes/locations.yml +61 -0
- data/spec/support/cassettes/property.yml +3 -3
- data/spec/support/cassettes/property_types.yml +61 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0739621ee28cf749ff5d7f36d70f174ef4e2a691
|
4
|
+
data.tar.gz: 9baa79fa27de606692962888a651740f4aa895ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dc7d6beb05ad0d7f7858a93bc5ae14ed7a4f649f1f213f57083b7148aaa6d124b9bce00905b6443a4d74db217c2b79e6a75a5bb5d8b406ee4fb7d836400fdf9
|
7
|
+
data.tar.gz: 0f98c7835341587029766e6055b0a1434d2b4181716bc7977419df6fa4671006370947ca4dec470a833c72f1b5a2cd6d3ccb5c0ac86b86ff8218fd27f16af4e4
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
|
5
5
|
|
6
|
+
## [3.4.0]
|
7
|
+
###
|
8
|
+
- Properties now return their associated location and types
|
9
|
+
|
6
10
|
## [3.3.0]
|
7
11
|
### Added
|
8
12
|
- Price change reasons are now passed as an array
|
@@ -79,5 +79,13 @@ module QuickTravel
|
|
79
79
|
def address
|
80
80
|
@_address ||= Address.new(@address)
|
81
81
|
end
|
82
|
+
|
83
|
+
def location
|
84
|
+
@_location ||= Location.find(location_id)
|
85
|
+
end
|
86
|
+
|
87
|
+
def property_types
|
88
|
+
@_property_types ||= PropertyType.all.select{ |pt| property_type_ids.include?(pt.id) }
|
89
|
+
end
|
82
90
|
end
|
83
91
|
end
|
data/lib/quick_travel/version.rb
CHANGED
data/spec/property_spec.rb
CHANGED
@@ -16,6 +16,14 @@ describe QuickTravel::Property do
|
|
16
16
|
VCR.use_cassette 'countries' do
|
17
17
|
QuickTravel::Country.all # preload countries for address
|
18
18
|
end
|
19
|
+
|
20
|
+
VCR.use_cassette 'locations' do
|
21
|
+
QuickTravel::Location.all # preload countries for address
|
22
|
+
end
|
23
|
+
|
24
|
+
VCR.use_cassette 'property_types' do
|
25
|
+
QuickTravel::PropertyType.all # preload countries for address
|
26
|
+
end
|
19
27
|
end
|
20
28
|
|
21
29
|
its(:id) { should eq 1 }
|
@@ -80,4 +88,16 @@ describe QuickTravel::Property do
|
|
80
88
|
end
|
81
89
|
end
|
82
90
|
end
|
91
|
+
|
92
|
+
context 'its location' do
|
93
|
+
subject(:location) { property.location }
|
94
|
+
|
95
|
+
its(:id) { should eq 5 }
|
96
|
+
end
|
97
|
+
|
98
|
+
context 'its property types' do
|
99
|
+
subject(:property_types) { property.property_types }
|
100
|
+
|
101
|
+
its(:size) { should eq 1 }
|
102
|
+
end
|
83
103
|
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://test.qt.sealink.com.au:8080/locations.json
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: access_key=<QT_KEY>
|
9
|
+
headers:
|
10
|
+
Content-Length:
|
11
|
+
- '0'
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: 'OK '
|
16
|
+
headers:
|
17
|
+
P3p:
|
18
|
+
- CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge,chrome=1
|
23
|
+
Etag:
|
24
|
+
- '"559340bc8df8e9afa56c4988e50056fd"'
|
25
|
+
Cache-Control:
|
26
|
+
- max-age=0, private, must-revalidate
|
27
|
+
X-Request-Id:
|
28
|
+
- dce465a4771d31fef9a11e7b5c1dd0a5
|
29
|
+
X-Runtime:
|
30
|
+
- '0.135948'
|
31
|
+
Vary:
|
32
|
+
- Origin
|
33
|
+
Date:
|
34
|
+
- Fri, 01 Jan 2016 02:32:38 GMT
|
35
|
+
X-Rack-Cache:
|
36
|
+
- miss
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Frame-Options:
|
42
|
+
- sameorigin
|
43
|
+
X-Permitted-Cross-Domain-Policies:
|
44
|
+
- none
|
45
|
+
X-Xss-Protection:
|
46
|
+
- 1; mode=block
|
47
|
+
Server:
|
48
|
+
- WEBrick/1.3.1 (Ruby/2.2.5/2016-04-26)
|
49
|
+
Content-Length:
|
50
|
+
- '3105'
|
51
|
+
Connection:
|
52
|
+
- Keep-Alive
|
53
|
+
Set-Cookie:
|
54
|
+
- _quick_travel_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWMwNjc3NWQ3OGQ4MjYyNDliMzkxNjYxNzQ5ZmJmOTZhBjsAVEkiCXVzZXIGOwBGaQY%3D--c66937bc6407b64b8cf72fc320799d0907d7de31;
|
55
|
+
path=/; HttpOnly
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: '[{"id":5,"name":"Adelaide CBD","region_ids":[3,19]},{"id":90,"name":"Aldinga Beach","region_ids":[9,19]},{"id":6,"name":"American River","region_ids":[1,19]},{"id":8,"name":"Antechamber Bay","region_ids":[1,19]},{"id":67,"name":"Apollo Bay","region_ids":[11]},{"id":89,"name":"Arkaba","region_ids":[10]},{"id":54,"name":"Ballarat","region_ids":[5]},{"id":10,"name":"Baudin Beach","region_ids":[1,19]},{"id":12,"name":"Brown Beach","region_ids":[1,19]},{"id":11,"name":"Brownlow","region_ids":[1,19]},{"id":37,"name":"Cape Borda","region_ids":[1,19]},{"id":38,"name":"Cape Du Couedic","region_ids":[1,19]},{"id":102,"name":"Cape Hart","region_ids":[1,19]},{"id":2,"name":"Cape Jervis","region_ids":[9,19]},{"id":36,"name":"Cape Willoughby","region_ids":[1,19]},{"id":101,"name":"Cassini","region_ids":[1,19]},{"id":59,"name":"Clare","region_ids":[7,19]},{"id":64,"name":"Coober Pedy","region_ids":[10]},{"id":72,"name":"Coonawarra","region_ids":[14]},{"id":97,"name":"Cygnet River","region_ids":[1,19]}]'
|
59
|
+
http_version:
|
60
|
+
recorded_at: Fri, 28 Oct 2016 05:28:14 GMT
|
61
|
+
recorded_with: VCR 3.0.3
|
@@ -55,12 +55,12 @@ http_interactions:
|
|
55
55
|
path=/; HttpOnly
|
56
56
|
body:
|
57
57
|
encoding: UTF-8
|
58
|
-
string: '{"id":1,"name":"Hilton Hotel","description":"","location_id":
|
58
|
+
string: '{"id":1,"name":"Hilton Hotel","description":"","location_id":5,"check_in":"2000-01-01T14:00:00Z","check_out":"2000-01-01T10:00:00Z","check_in_instructions":"","star_rating":null,"contact_id":null,"notes":"","tourism_accredited":false,"season_id":9,"boundary_start":"2013-03-01","boundary_end":"2013-03-01","created_at":"2013-03-01T00:01:41+10:30","updated_at":"2013-03-01T00:55:56+10:30","address":{"id":1,"address_line1":"Level
|
59
59
|
2","address_line2":"1 Victoria Square","city":"Adelaide","state":"SA","post_code":"5000","created_at":"2013-03-01T00:01:41+10:30","updated_at":"2013-03-01T00:07:29+10:30","party_id":null,"country_id":14,"property_id":1},"location_name":"Adelaide
|
60
60
|
CBD","region_names":"Adelaide","property_facilities":[{"id":1,"name":"Pool","created_at":"2013-03-01T00:01:07+10:30","updated_at":"2013-03-01T00:01:07+10:30","category_id":1,"position":1},{"id":2,"name":"Spa","created_at":"2013-03-01T00:01:14+10:30","updated_at":"2013-03-01T00:01:25+10:30","category_id":1,"position":1}],"graphics":[],"maximum_occupancy":2,"accommodations":[{"id":6,"name":"Executive
|
61
61
|
Room","product_type_id":2,"default_capacity":2,"type":"Accommodation","inventory_type":0,"maximum_occupancy":2,"location_id":1,"property_id":1,"fare_basis_pointer_id":6,"disclaimer_id":null,"deposit_rule_id":null,"vendor_id":null,"maximum_weight":null,"days_before_inventory_expires":null,"property_type_id":1,"star_rating":null,"booking_notes":"","expiry_units":null,"uses":null,"inline_price_in_cents":null,"inline_cost_in_cents":null,"expiry_level":null,"unlimited_uses":false,"no_expiry":false,"reason_required":false,"resource_category_id":null,"created_at":"2013-03-01T00:08:49+10:30","updated_at":"2013-03-01T00:55:56+10:30","code":"","restrict_to_client_types":false,"minimum_age":null,"guardian_minimum_age":null,"book_before_level":null,"book_before_units":"seconds","maximum_passengers_online":null,"active":true,"report_changes":false,"inline_pricing":false,"bookable_individually":true,"minimum_passengers":null,"maximum_passengers":null,"required_number_of_vehicles":null,"frequent_traveller_points_multiplier":null,"commissionable":true,"masterpoint_resource_id":null,"print_tickets":false,"individual_tickets":null,"frequent_traveller_redemption_rate":null,"position":null,"ticket_template_id":null,"generate_tickets_by_quantity":true,"room_facilities":[{"id":1,"name":"Shower","created_at":"2013-03-01T00:01:38+10:30","updated_at":"2013-03-01T00:01:38+10:30","category_id":2,"position":1},{"id":3,"name":"Hairdryer","created_at":"2013-03-01T00:01:49+10:30","updated_at":"2013-03-01T00:01:49+10:30","category_id":2,"position":3}],"bed_configurations":[{"id":1,"creator_id":null,"updator_id":null,"resource_id":6,"created_at":"2013-03-01T00:08:49+10:30","updated_at":"2015-11-18T13:59:23+10:30","overriding_fare_basis_pointer_id":null,"name":"1
|
62
62
|
x Double and 1 x Single","active":true,"position":1}],"description":"A basic
|
63
|
-
studio room","graphics":[],"on_request":false,"minimum_price":{"2016-01-01":20000},"nightly_price":{"2016-01-01":20000},"availability":{"2016-01-01":false},"minimum_bookable_duration":null}]}'
|
64
|
-
http_version:
|
63
|
+
studio room","graphics":[],"on_request":false,"minimum_price":{"2016-01-01":20000},"nightly_price":{"2016-01-01":20000},"availability":{"2016-01-01":false},"minimum_bookable_duration":null}],"property_type_ids":[1]}'
|
64
|
+
http_version:
|
65
65
|
recorded_at: Fri, 28 Oct 2016 05:28:14 GMT
|
66
66
|
recorded_with: VCR 3.0.3
|
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://test.qt.sealink.com.au:8080/property_types.json
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: access_key=<QT_KEY>
|
9
|
+
headers:
|
10
|
+
Content-Length:
|
11
|
+
- '0'
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: 'OK '
|
16
|
+
headers:
|
17
|
+
P3p:
|
18
|
+
- CP="IDC DSP CAO COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
|
19
|
+
Content-Type:
|
20
|
+
- application/json; charset=utf-8
|
21
|
+
X-Ua-Compatible:
|
22
|
+
- IE=Edge,chrome=1
|
23
|
+
Etag:
|
24
|
+
- '"559340bc8df8e9afa56c4988e50056fd"'
|
25
|
+
Cache-Control:
|
26
|
+
- max-age=0, private, must-revalidate
|
27
|
+
X-Request-Id:
|
28
|
+
- dce465a4771d31fef9a11e7b5c1dd0a5
|
29
|
+
X-Runtime:
|
30
|
+
- '0.135948'
|
31
|
+
Vary:
|
32
|
+
- Origin
|
33
|
+
Date:
|
34
|
+
- Fri, 01 Jan 2016 02:32:38 GMT
|
35
|
+
X-Rack-Cache:
|
36
|
+
- miss
|
37
|
+
X-Content-Type-Options:
|
38
|
+
- nosniff
|
39
|
+
X-Download-Options:
|
40
|
+
- noopen
|
41
|
+
X-Frame-Options:
|
42
|
+
- sameorigin
|
43
|
+
X-Permitted-Cross-Domain-Policies:
|
44
|
+
- none
|
45
|
+
X-Xss-Protection:
|
46
|
+
- 1; mode=block
|
47
|
+
Server:
|
48
|
+
- WEBrick/1.3.1 (Ruby/2.2.5/2016-04-26)
|
49
|
+
Content-Length:
|
50
|
+
- '3105'
|
51
|
+
Connection:
|
52
|
+
- Keep-Alive
|
53
|
+
Set-Cookie:
|
54
|
+
- _quick_travel_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJWMwNjc3NWQ3OGQ4MjYyNDliMzkxNjYxNzQ5ZmJmOTZhBjsAVEkiCXVzZXIGOwBGaQY%3D--c66937bc6407b64b8cf72fc320799d0907d7de31;
|
55
|
+
path=/; HttpOnly
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: '[{"id":6,"name":"Bed and Breakfast","position":1,"created_at":"2011-04-07T07:07:14+09:30","updated_at":"2014-02-04T16:00:14+10:30"},{"id":4,"name":"Non Hosted Bed and Breakfast","position":2,"created_at":"2011-04-07T07:07:14+09:30","updated_at":"2011-04-07T07:07:14+09:30"},{"id":1,"name":"Hotel or Motel","position":3,"created_at":"2011-04-07T07:07:14+09:30","updated_at":"2011-04-07T07:07:14+09:30"},{"id":7,"name":"Self Contained","position":4,"created_at":"2011-04-07T07:07:14+09:30","updated_at":"2011-04-07T07:07:14+09:30"},{"id":12,"name":"Luxury Retreats","position":5,"created_at":"2017-02-13T16:03:04+10:30","updated_at":"2017-02-13T16:03:04+10:30"},{"id":10,"name":"Caravan and Camping","position":6,"created_at":"2011-04-07T07:07:14+09:30","updated_at":"2011-04-07T07:07:14+09:30"},{"id":5,"name":"Lodge or Backpackers","position":7,"created_at":"2011-04-07T07:07:14+09:30","updated_at":"2016-10-31T15:21:46+10:30"},{"id":8,"name":"Groups","position":8,"created_at":"2011-04-07T07:07:14+09:30","updated_at":"2011-04-07T07:07:14+09:30"},{"id":9,"name":"Ski","position":9,"created_at":"2011-04-07T07:07:14+09:30","updated_at":"2011-04-07T07:07:14+09:30"},{"id":11,"name":"Cruise Ship","position":10,"created_at":"2014-09-25T08:31:00+09:30","updated_at":"2014-09-25T08:31:00+09:30"}]'
|
59
|
+
http_version:
|
60
|
+
recorded_at: Fri, 28 Oct 2016 05:28:14 GMT
|
61
|
+
recorded_with: VCR 3.0.3
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quicktravel_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Noack
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-09-04 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -384,6 +384,7 @@ files:
|
|
384
384
|
- spec/support/cassettes/country_all.yml
|
385
385
|
- spec/support/cassettes/create_reservation_fail.yml
|
386
386
|
- spec/support/cassettes/create_reservation_with_booking.yml
|
387
|
+
- spec/support/cassettes/locations.yml
|
387
388
|
- spec/support/cassettes/passenger_all.yml
|
388
389
|
- spec/support/cassettes/payment_info.yml
|
389
390
|
- spec/support/cassettes/price_quote.yml
|
@@ -395,6 +396,7 @@ files:
|
|
395
396
|
- spec/support/cassettes/product_type_resource_categories_tickets.yml
|
396
397
|
- spec/support/cassettes/product_type_routes.yml
|
397
398
|
- spec/support/cassettes/property.yml
|
399
|
+
- spec/support/cassettes/property_types.yml
|
398
400
|
- spec/support/cassettes/region_show.yml
|
399
401
|
- spec/support/cassettes/reservation_with_extra_picks.yml
|
400
402
|
- spec/support/cassettes/resource_category_all.yml
|
@@ -475,6 +477,7 @@ test_files:
|
|
475
477
|
- spec/support/cassettes/country_all.yml
|
476
478
|
- spec/support/cassettes/create_reservation_fail.yml
|
477
479
|
- spec/support/cassettes/create_reservation_with_booking.yml
|
480
|
+
- spec/support/cassettes/locations.yml
|
478
481
|
- spec/support/cassettes/passenger_all.yml
|
479
482
|
- spec/support/cassettes/payment_info.yml
|
480
483
|
- spec/support/cassettes/price_quote.yml
|
@@ -486,6 +489,7 @@ test_files:
|
|
486
489
|
- spec/support/cassettes/product_type_resource_categories_tickets.yml
|
487
490
|
- spec/support/cassettes/product_type_routes.yml
|
488
491
|
- spec/support/cassettes/property.yml
|
492
|
+
- spec/support/cassettes/property_types.yml
|
489
493
|
- spec/support/cassettes/region_show.yml
|
490
494
|
- spec/support/cassettes/reservation_with_extra_picks.yml
|
491
495
|
- spec/support/cassettes/resource_category_all.yml
|