suitcase 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -2
- data/lib/suitcase/hotel/hotel.rb +7 -2
- data/lib/suitcase/version.rb +1 -1
- data/test/hotels/hotel_test.rb +7 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -71,9 +71,9 @@ Caching is not recommended for car rentals, because they all change so quickly.
|
|
71
71
|
Contributing
|
72
72
|
------------
|
73
73
|
|
74
|
-
### Running the
|
74
|
+
### Running the tests
|
75
75
|
|
76
|
-
To set up for the
|
76
|
+
To set up for the tests, you need to edit the file `test/keys.rb` with the proper information. Currently, testing reservations is unsupported. You can run the tests with the default rake task by running `rake` from the command line.
|
77
77
|
|
78
78
|
### Pull requests/issues
|
79
79
|
|
data/lib/suitcase/hotel/hotel.rb
CHANGED
@@ -170,8 +170,13 @@
|
|
170
170
|
params = info.dup
|
171
171
|
params["numberOfResults"] = params[:results] ? params[:results] : 10
|
172
172
|
params.delete(:results)
|
173
|
-
|
174
|
-
|
173
|
+
if params[:destination_id]
|
174
|
+
params["destinationId"] = params[:destination_id]
|
175
|
+
params.delete(:destination_id)
|
176
|
+
elsif params[:location]
|
177
|
+
params["destinationString"] = params[:location]
|
178
|
+
params.delete(:location)
|
179
|
+
end
|
175
180
|
|
176
181
|
amenities = params[:amenities] ? params[:amenities].map {|amenity|
|
177
182
|
AMENITIES[amenity]
|
data/lib/suitcase/version.rb
CHANGED
data/test/hotels/hotel_test.rb
CHANGED
@@ -20,11 +20,17 @@ describe Suitcase::Hotel do
|
|
20
20
|
@hotel.must_be_kind_of(Suitcase::Hotel)
|
21
21
|
end
|
22
22
|
|
23
|
-
it "returns multiple Hotels if
|
23
|
+
it "returns multiple Hotels if a location is passed in" do
|
24
24
|
hotels = Suitcase::Hotel.find(location: "London, UK")
|
25
25
|
hotels.must_be_kind_of(Array)
|
26
26
|
hotels.first.must_be_kind_of(Suitcase::Hotel)
|
27
27
|
end
|
28
|
+
|
29
|
+
it "returns multiple Hotels if a destination ID is passed in" do
|
30
|
+
hotels = Suitcase::Hotel.find(destination_id: "58870F43-9215-4662-BAA1-CC9A20FEC4F1")
|
31
|
+
hotels.must_be_kind_of(Array)
|
32
|
+
hotels.first.must_be_kind_of(Suitcase::Hotel)
|
33
|
+
end
|
28
34
|
|
29
35
|
it "returns multiple Hotels if multiple ID's are passed in" do
|
30
36
|
hotels = Suitcase::Hotel.find(ids: [123904, 191937, 220166])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suitcase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|