wego 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -0
- data/lib/wego/version.rb +1 -1
- data/spec/support/fake_wego_api.rb +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af58bf962cd2fbfa922eb201889b6583ad83d8f6
|
4
|
+
data.tar.gz: 8d00f570cbb98a78cf040f8dbcab9203b77bf9ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b5da6c82c7c7e4fcc89ab55a69be3f3ffe267dbedbb248149dc83112829b926e6790b7331bfe6b4e616d1e6c7c30163cb28a24a384828acaa7b077d665a3d4a
|
7
|
+
data.tar.gz: 25c6657964c62d6f00247e6769c96c70f2f10d2d70c834533ebf9eece90ed768cc00dc64e7e45a3861d8c8ae52804ccc6584d27c9d2172c3c6666d44d60e9cfc
|
data/README.md
CHANGED
@@ -178,6 +178,42 @@ test helpers.
|
|
178
178
|
require "wego/rspec"
|
179
179
|
```
|
180
180
|
|
181
|
+
##### Find a location
|
182
|
+
|
183
|
+
```ruby
|
184
|
+
stub_get_location_api(q: location_name, lang: 1, page: 1, per_page: 10)
|
185
|
+
```
|
186
|
+
|
187
|
+
##### Create a new search
|
188
|
+
|
189
|
+
```ruby
|
190
|
+
stub_new_search_api(search_term_as_hash)
|
191
|
+
```
|
192
|
+
|
193
|
+
##### Search results
|
194
|
+
|
195
|
+
```ruby
|
196
|
+
stub_search_results_api(search_id, additional_option_hash)
|
197
|
+
```
|
198
|
+
|
199
|
+
##### Search result (Hotel)
|
200
|
+
|
201
|
+
```ruby
|
202
|
+
stub_search_result_api(search_id: search_id, hotel_id: hotel_id, **options)
|
203
|
+
```
|
204
|
+
|
205
|
+
##### Invalid search result
|
206
|
+
|
207
|
+
```ruby
|
208
|
+
stub_invalid_search_result_api(option_hash)
|
209
|
+
```
|
210
|
+
|
211
|
+
##### Invalid API response
|
212
|
+
|
213
|
+
```ruby
|
214
|
+
stub_invalid_api_response(status: status_code)
|
215
|
+
```
|
216
|
+
|
181
217
|
## Contributing
|
182
218
|
|
183
219
|
First, thank you for contributing! We love pull requests from everyone. By
|
data/lib/wego/version.rb
CHANGED
@@ -11,9 +11,20 @@ module FakeWegoApi
|
|
11
11
|
stub_api_response("search/#{search_id}", options, filename: "results")
|
12
12
|
end
|
13
13
|
|
14
|
-
def stub_search_result_api(search_id:, hotel_id
|
14
|
+
def stub_search_result_api(search_id:, hotel_id:, **options)
|
15
15
|
stub_api_response(
|
16
|
-
"search/#{search_id}",
|
16
|
+
"search/#{search_id}",
|
17
|
+
options.merge(hotel_id: hotel_id),
|
18
|
+
filename: "result"
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
def stub_invalid_search_result_api(search_id:, hotel_id:, **options)
|
23
|
+
stub_api_response(
|
24
|
+
"search/#{search_id}",
|
25
|
+
options.merge(hotel_id: hotel_id),
|
26
|
+
filename: "error",
|
27
|
+
status: 400
|
17
28
|
)
|
18
29
|
end
|
19
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wego
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abu Nashir
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|