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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWU4YmM5ODgzNGJmYjllNTVkYTEwZjI0NGNiZGEzMDI4MTY3ZmQwMA==
4
+ NmU5Mjk4ZGExZWI4ZmE5YzI5OTg5ZGM1NGM3NWY5YjI0ODUwODA3Mg==
5
5
  data.tar.gz: !binary |-
6
- NDkxNmI2M2JjYWIxNThkNzc2MGQxOWQyOTMwN2MxMmFhYzdlNjMwNA==
6
+ OTkxZTJlMmFjZGI3ZGI3OGVhZjMzZmQ3NmRhZGUwMTM0NmYyMmNhYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzNhZTc0NTU3Y2QyYjVhM2I1YjVlZmJlMWE1ZTE0OTQ1ZWFkZDk3ZGI1ZTA1
10
- ZTBkOGVhMGFjYmE0NGRlNTljZjUzNmU4NmU3ZGZmZWU0YTk3MDFkYTkxZGJj
11
- ZGYyZTI3NzgxZjZhOWIzZWY4NzEwMGI2ZTk1YmQ3YjkwNzYxOTA=
9
+ MDhmNDVhNWJjODg5YTMyZDU2MmE0NjQ4YTFmYjM0OTE2MDZlY2M0MDBkODMx
10
+ YzVjYWM3OWYwMWQ2YmE5ZDQ0ZTBjN2E0ZjQwZWRhNDFlNzY2OTIzNzljOTVk
11
+ OTkzNDMwZGIxODhhNGJkYmExNmY1MjM0MTZlZThhYzA5NTIyOWI=
12
12
  data.tar.gz: !binary |-
13
- ZDkzYjY3MGRjMDNkM2U4OWZmNDdkYTIzYmM0ZTBiNjJmOWZkOTQzYmQzYmYx
14
- NmNlODYyZWMxNWI1MzM0OTNiZDBjNGVjNmExNjNmYTEzY2JhZjA5ZDNlZDU3
15
- MWQyN2U1ZTE0YTIzZGI1ODFlMjU1YjI3YjUzM2RkNmNlYTc1M2E=
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.19' #La version se debe incrementar cada vez que se desea publicar una nueva version del test.
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mock_search
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.19'
4
+ version: '0.20'
5
5
  platform: ruby
6
6
  authors:
7
7
  - lgonzalez