mock_search 0.15 → 0.16
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 +2 -2
- data/lib/mock_search/mock_search_multipledestinations.rb +6 -6
- data/lib/mock_search/mock_search_roundtrip.rb +29 -29
- data/mock_search.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZWRiYjA2M2VjNjE5NDQ0MDUzNTQ5ZGM3MjI3MDM2MWQ1MjgyZjg0ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NmU2ZDEyZjdlMTJiNzRkOTcwZWU2Njc2YjU5YmRkMmU1ZGIzZDllMQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGZjZjEzYTIyM2RhMjBiYWI4NzlhMmQ4OWY3ZjkwM2U2YzA5Y2M1MDU1YTc0
|
10
|
+
ZmYwYjBjOTE1ZGYwY2U4ZjYyYWJhN2JhMmZkOThmZGM3ZjcxMGY0YzQzZGFj
|
11
|
+
ZWQ4N2QwYzA1NzM1ZTA4ZGU5NzM5MDVmMDRiZDI5OWJhOTZiMmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGE3M2I0MjBiMDI3ZDQ2MGJjYTFkNTM4Njk1NTA4MGJiODNkMmQ1NDg4NmYw
|
14
|
+
NmYwOGI1ZGZhNGVjZTRhMWU1MjAwYzFiODUwYzdlNWI1MzZmMTBmNTFlZmZl
|
15
|
+
M2QxYjk1NzYwMTQwNDkxMzZjZmNiZmFjOTc3Nzg5OTYwYzk5ZWU=
|
data/lib/mock_search.rb
CHANGED
@@ -25,8 +25,8 @@ class MockSearch
|
|
25
25
|
|
26
26
|
def to_city_change(site)
|
27
27
|
unless site == @site
|
28
|
-
@
|
29
|
-
@path = @path.gsub(/^...\/...\//,"#{@
|
28
|
+
@city_to_1 = MockCity.new(site)
|
29
|
+
@path = @path.gsub(/^...\/...\//,"#{@city_from_1.code}/#{@city_to_1.code}/")
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -19,14 +19,14 @@ class MockSearchMultipledestinations < MockSearch
|
|
19
19
|
|
20
20
|
#genero una url de busqueda basica
|
21
21
|
def generate_url_results_search(params = "",site_country=nil)
|
22
|
-
|
23
|
-
|
22
|
+
to_city_change(site_country) if site_country
|
23
|
+
return @host + "/shop/flights/results/multipledestinations/" + @path + params
|
24
24
|
end
|
25
25
|
|
26
26
|
#genero una url para ingresar a desambiguacion de aeropuertos
|
27
27
|
def generate_url_disambiguation_airports(city)
|
28
|
-
|
29
|
-
|
28
|
+
@path = "#{@city_from_1.code},#{city},#{@city_from_3.code}/#{city},#{@city_to_2.code},#{@city_to_3.code}/#{@date_from_1},#{@date_from_2},#{@date_from_3}/#{passengers}"
|
29
|
+
return @host + "/shop/flights/disambiguation/airports/multipledestinations/" + @path
|
30
30
|
end
|
31
31
|
|
32
32
|
#genero una url para ingresar a desambiguacion de ciudades
|
@@ -36,7 +36,7 @@ class MockSearchMultipledestinations < MockSearch
|
|
36
36
|
|
37
37
|
#genero una url para una busqueda anticipada
|
38
38
|
def generate_url_anticipated_search()
|
39
|
-
|
39
|
+
return @host + "/shop/flights/test/data/search/begin/multipledestinations/" + @path
|
40
40
|
end
|
41
41
|
|
42
42
|
def get_advanced_bussinnes
|
@@ -48,7 +48,7 @@ class MockSearchMultipledestinations < MockSearch
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def to_city_description()
|
51
|
-
|
51
|
+
return "#{@city_to_1},#{@city_to_2},#{@city_to_3}"
|
52
52
|
end
|
53
53
|
|
54
54
|
end
|
@@ -5,59 +5,59 @@ class MockSearchRoundtrip < MockSearch
|
|
5
5
|
def initialize(site,env,cabotage)
|
6
6
|
super(site,env,cabotage)
|
7
7
|
@city_from_1 = MockCity.new(@site)
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
@city_to_1 = @city_from_1.generate_to_city(@cabotage)
|
9
|
+
@date_from_1 = Date.today + 60 + rand(15)
|
10
|
+
@date_to_1 = @date_from_1 + rand(15)
|
11
|
+
@description = "roundtrip"
|
12
|
+
@path = "#{@city_from_1.code}/#{@city_to_1.code}/#{@date_from_1}/#{@date_to_1}/#{passengers}"
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
#genero una url de busqueda basica
|
16
16
|
def generate_url_results_search(params = "",site_country=nil)
|
17
|
-
|
18
|
-
|
17
|
+
to_city_change(site_country) if site_country
|
18
|
+
return @host + "/shop/flights/results/roundtrip/" + @path + params
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
#genero una url para ingresar a desambiguacion de aeropuertos
|
22
22
|
def generate_url_disambiguation_airports(city)
|
23
|
-
|
24
|
-
|
23
|
+
@path = "#{@city_from_1.code}/#{city}/#{@date_from_1}/#{@date_to_1}/#{passengers}"
|
24
|
+
return @host + "/shop/flights/disambiguation/airports/roundtrip/" + @path
|
25
25
|
end
|
26
26
|
|
27
|
-
|
27
|
+
#genero una url para ingresar a desambiguacion de ciudades
|
28
28
|
def generate_url_disambiguation_city()
|
29
|
-
|
29
|
+
return @host + "/shop/flights/search/roundtrip/" + @path.gsub(/(\D{3})\/(\D{3})\//,"___/___/") + "?toDescriptions=test1&fromDescriptions=test2"
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
#genero una url para una busqueda anticipada
|
33
33
|
def generate_url_anticipated_search()
|
34
|
-
|
34
|
+
return @host + "/shop/flights/test/data/search/begin/roundtrip/" + @path
|
35
35
|
end
|
36
36
|
|
37
|
-
|
37
|
+
#genero la url de resultados de landing a partir de una ciudad de salida y una ciudad de destino
|
38
38
|
def generate_url_landing_search(dep,ret)
|
39
39
|
landing = (@site == "BR" ? "/passagens-aereas" : "/vuelos")
|
40
40
|
return @host + landing + "/#{dep}/#{ret}"
|
41
41
|
end
|
42
42
|
|
43
|
-
|
43
|
+
#genero la url para ingresar a la home de vuelos
|
44
44
|
def generate_url_landing_home()
|
45
|
-
|
46
|
-
|
45
|
+
landing = (@site == "BR" ? "/passagens-aereas" : "/vuelos")
|
46
|
+
return @host + landing
|
47
47
|
end
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
def get_advanced_bussinnes()
|
50
|
+
return "/NA/NA/C/NA/NA"
|
51
|
+
end
|
52
52
|
|
53
53
|
def get_indec_airlines(env)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
54
|
+
servers = {
|
55
|
+
"rc"=>"http://lb.despegar.it/",
|
56
|
+
"beta"=>"http://backoffice.despegar.com/",
|
57
|
+
"produccion"=>"http://backoffice.despegar.com/"
|
58
|
+
}
|
59
|
+
respond = HTTParty.get("#{servers[env.downcase]}indec/airlines/byroute/#{@site}/#{@city_from_1.code}/#{@city_to_1.code}")
|
60
|
+
return respond
|
61
61
|
end
|
62
62
|
|
63
63
|
def get_to_city_description()
|
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.16' #La version se debe incrementar cada vez que se desea publicar una nueva version del test.
|
19
19
|
|
20
20
|
gem.add_development_dependency('geminabox')
|
21
21
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mock_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.16'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lgonzalez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: geminabox
|