mock_search 0.19 → 0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/mock_search.rb +17 -0
- data/mock_search.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmU5Mjk4ZGExZWI4ZmE5YzI5OTg5ZGM1NGM3NWY5YjI0ODUwODA3Mg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTkxZTJlMmFjZGI3ZGI3OGVhZjMzZmQ3NmRhZGUwMTM0NmYyMmNhYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDhmNDVhNWJjODg5YTMyZDU2MmE0NjQ4YTFmYjM0OTE2MDZlY2M0MDBkODMx
|
10
|
+
YzVjYWM3OWYwMWQ2YmE5ZDQ0ZTBjN2E0ZjQwZWRhNDFlNzY2OTIzNzljOTVk
|
11
|
+
OTkzNDMwZGIxODhhNGJkYmExNmY1MjM0MTZlZThhYzA5NTIyOWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGYwMWYxNzE1MTI3OTI5ZmNjM2JiZmM4MGMyOGU1MmZlYjQwZDdhY2MwZGY0
|
14
|
+
ZWQ4YjMyMTI0ZGMzYTM4YjU3YTE2OWRiM2U1Mjk0MWM3M2FiYzFhMWNlZjEy
|
15
|
+
MTRmMWQyMTBlNzUyZDc0YjQzYzViNDc3MjEyYTk2OTUyMzEzZDU=
|
data/lib/mock_search.rb
CHANGED
@@ -54,6 +54,23 @@ class MockSearch
|
|
54
54
|
return HTTParty.get(self.generate_url_results_search_service,:headers => {"referer" => self.generate_url_results_search})
|
55
55
|
end
|
56
56
|
|
57
|
+
def get_ticket_date()
|
58
|
+
@result_hash = {}
|
59
|
+
|
60
|
+
json = get_results_search_service
|
61
|
+
itinerary = json['response']['items'][0]['itinerary']
|
62
|
+
ticket = json['response']['ticket']
|
63
|
+
|
64
|
+
@result_hash['search_hash'] = ticket['hash']
|
65
|
+
@result_hash['search_version'] = ticket['version']
|
66
|
+
@result_hash['itineraryHash'] = itinerary['itineraryInfo']['id']
|
67
|
+
end
|
68
|
+
|
69
|
+
def generate_url_checkout()
|
70
|
+
self.get_ticket_date()
|
71
|
+
return @host.gsub('http','https') + "/book/flights/checkout/#{@resultHash['searchId']}/#{@resultHash['searchVersion']}/#{@resultHash['itineraryHash']}/"
|
72
|
+
end
|
73
|
+
|
57
74
|
def digest_md5()
|
58
75
|
return Digest::MD5.hexdigest(self.generate_url_results_search+"despegar")
|
59
76
|
end
|
data/mock_search.gemspec
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
gem.require_paths = ["lib"] #Usualmente es solo lib -> ["lib"]
|
17
17
|
|
18
|
-
gem.version = '0.
|
18
|
+
gem.version = '0.20' #La version se debe incrementar cada vez que se desea publicar una nueva version del test.
|
19
19
|
|
20
20
|
gem.add_dependency('httparty')
|
21
21
|
|