mock_search 0.14 → 0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/mock_search/mock_search_multipledestinations.rb +16 -24
- data/lib/mock_search/mock_search_oneway.rb +14 -23
- data/lib/mock_search/mock_search_roundtrip.rb +47 -54
- data/lib/mock_search.rb +1 -0
- 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
|
+
ZWM2ZmZhOTJlYjFhNGVkZWE1ODdiZDIyYzdhZTk5YTZhMjA5ZWU3Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTRmZWE1ZTA2Y2UzYzQ4NjUzYTVlM2Y5M2M3NGM5MTliZTNiMGJmYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTAwODY2ZjlmZmU5N2QxOTU2NjQ0NDVhNzllY2I1YmQ3ZDlkMjQ3NTVkMjk0
|
10
|
+
ODYzNjgxMTUzNjQyNTViNjhhYmFmN2I3MmJkYTAxYzdlMWJhNmE5MzZmZjJh
|
11
|
+
MGRhNTUwY2RiNmQxYThjZWRmZDdmOTU1Y2RmYzg5ODI5MTZlMGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Y2E2MDUwNTI0NTg3ZmRjZWJlZjU5YjBkYmZkZGY4ZGI5Y2JmYTQ4MjI1YmI5
|
14
|
+
NzU4NGVlNGI1ODA1NzYwYmNjMjc3OTI2OGJhYjk4YTE4ZGI3NzQ0ZmNhMjk5
|
15
|
+
YjdkMTc2NGZhYTRkMGUzOTU2MTgyYjdiYzRiMWIwNzRjNmRkMWI=
|
@@ -17,39 +17,31 @@ class MockSearchMultipledestinations < MockSearch
|
|
17
17
|
@path = "#{@city_from_1.code},#{@city_from_2.code},#{@city_from_3.code}/#{@city_to_1.code},#{@city_to_2.code},#{@city_to_3.code}/#{@date_from_1},#{@date_from_2},#{@date_from_3}/#{passengers}"
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
def generate_query_string_search_url()
|
29
|
-
return @host + "/shop/flights/search/multipledestinations/" + @path + "?param1=1"
|
30
|
-
end
|
31
|
-
|
32
|
-
def generate_airports_disambiguation_search_url(city)
|
20
|
+
#genero una url de busqueda basica
|
21
|
+
def generate_url_results_search(params = "",site_country=nil)
|
22
|
+
to_city_change(site_country) if site_country
|
23
|
+
return @host + "/shop/flights/results/multipledestinations/" + @path + params
|
24
|
+
end
|
25
|
+
|
26
|
+
#genero una url para ingresar a desambiguacion de aeropuertos
|
27
|
+
def generate_url_disambiguation_airports(city)
|
33
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}"
|
34
29
|
return @host + "/shop/flights/disambiguation/airports/multipledestinations/" + @path
|
35
30
|
end
|
36
31
|
|
37
|
-
|
32
|
+
#genero una url para ingresar a desambiguacion de ciudades
|
33
|
+
def generate_url_disambiguation_city()
|
38
34
|
return @host + "/shop/flights/search/multipledestinations/" + @path.gsub(/(\D{3}),(\D{3}),(\D{3})\/(\D{3}),(\D{3}),(\D{3})\//,"___,___,___/___,___,___/") + "?toDescriptions=test1,test2,test3&fromDescriptions=test4,test5,test6"
|
39
35
|
end
|
40
|
-
|
41
|
-
|
36
|
+
|
37
|
+
#genero una url para una busqueda anticipada
|
38
|
+
def generate_url_anticipated_search()
|
42
39
|
return @host + "/shop/flights/test/data/search/begin/multipledestinations/" + @path
|
43
40
|
end
|
44
41
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
def generate_search_url_for_country(site_country)
|
50
|
-
to_city_change(site_country)
|
51
|
-
return @host + "/shop/flights/results/multipledestinations/" + @path
|
52
|
-
end
|
42
|
+
def get_advanced_bussinnes
|
43
|
+
return ""
|
44
|
+
end
|
53
45
|
|
54
46
|
def get_indec_airlines(env)
|
55
47
|
return []
|
@@ -11,38 +11,30 @@ class MockSearchOneway < MockSearch
|
|
11
11
|
@path = "#{@city_from_1.code}/#{@city_to_1.code}/#{@date_from_1}/#{passengers}"
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
#genero una url de busqueda basica
|
15
|
+
def generate_url_results_search(params = "",site_country=nil)
|
16
|
+
to_city_change(site_country) if site_country
|
17
|
+
return @host + "/shop/flights/results/oneway/" + @path + params
|
16
18
|
end
|
17
19
|
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
def generate_query_string_search_url()
|
23
|
-
return @host + "/shop/flights/search/oneway/" + @path + "?param1=1"
|
24
|
-
end
|
25
|
-
|
26
|
-
def generate_airports_disambiguation_search_url(city)
|
20
|
+
#genero una url para ingresar a desambiguacion de aeropuertos
|
21
|
+
def generate_url_disambiguation_airports(city)
|
27
22
|
@path = "#{@city_from_1.code}/#{city}/#{@date_from_1}/#{passengers}"
|
28
23
|
return @host + "/shop/flights/disambiguation/airports/oneway/" + @path
|
29
24
|
end
|
30
|
-
|
31
|
-
|
25
|
+
|
26
|
+
#genero una url para ingresar a desambiguacion de ciudades
|
27
|
+
def generate_url_disambiguation_city()
|
32
28
|
return @host + "/shop/flights/search/oneway/" + @path.gsub(/(\D{3})\/(\D{3})\//,"___/___/") + "?toDescriptions=test1&fromDescriptions=test2"
|
33
29
|
end
|
34
30
|
|
35
|
-
|
31
|
+
#genero una url para una busqueda anticipada
|
32
|
+
def generate_url_anticipated_search()
|
36
33
|
return @host + "/shop/flights/test/data/search/begin/oneway/" + @path
|
37
34
|
end
|
38
|
-
|
39
|
-
def
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
|
-
def generate_search_url_for_country(site_country)
|
44
|
-
to_city_change(site_country)
|
45
|
-
return @host + "/shop/flights/results/oneway/" + @path
|
35
|
+
|
36
|
+
def get_advanced_bussinnes()
|
37
|
+
return "/NA/C/NA/NA"
|
46
38
|
end
|
47
39
|
|
48
40
|
def get_indec_airlines(env)
|
@@ -51,7 +43,6 @@ class MockSearchOneway < MockSearch
|
|
51
43
|
"beta"=>"http://backoffice.despegar.com/",
|
52
44
|
"produccion"=>"http://backoffice.despegar.com/"
|
53
45
|
}
|
54
|
-
puts "#{servers[env.downcase]}indec/airlines/byroute/#{@site}/#{@city_from_1.code}/#{@city_to_1.code}"
|
55
46
|
respond = HTTParty.get("#{servers[env.downcase]}indec/airlines/byroute/#{@site}/#{@city_from_1.code}/#{@city_to_1.code}")
|
56
47
|
return respond
|
57
48
|
end
|
@@ -12,75 +12,68 @@ class MockSearchRoundtrip < MockSearch
|
|
12
12
|
@path = "#{@city_from_1.code}/#{@city_to_1.code}/#{@date_from_1}/#{@date_to_1}/#{passengers}"
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
def advanced_bussinnes
|
20
|
-
return "/NA/NA/C/NA/NA"
|
21
|
-
end
|
22
|
-
|
23
|
-
def generate_query_string_search_url()
|
24
|
-
return @host + "/shop/flights/search/roundtrip/" + @path + "?param1=1"
|
15
|
+
#genero una url de busqueda basica
|
16
|
+
def generate_url_results_search(params = "",site_country=nil)
|
17
|
+
to_city_change(site_country) if site_country
|
18
|
+
return @host + "/shop/flights/results/roundtrip/" + @path + params
|
25
19
|
end
|
26
20
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
def generate_city_disambiguation_search_url()
|
33
|
-
return @host + "/shop/flights/search/roundtrip/" + @path.gsub(/(\D{3})\/(\D{3})\//,"___/___/") + "?toDescriptions=test1&fromDescriptions=test2"
|
34
|
-
end
|
35
|
-
|
36
|
-
def generate_anticipated_search_url()
|
37
|
-
return @host + "/shop/flights/test/data/search/begin/roundtrip/" + @path
|
38
|
-
end
|
21
|
+
#genero una url para ingresar a desambiguacion de aeropuertos
|
22
|
+
def generate_url_disambiguation_airports(city)
|
23
|
+
@path = "#{@city_from_1.code}/#{city}/#{@date_from_1}/#{@date_to_1}/#{passengers}"
|
24
|
+
return @host + "/shop/flights/disambiguation/airports/roundtrip/" + @path
|
25
|
+
end
|
39
26
|
|
40
|
-
|
41
|
-
|
27
|
+
#genero una url para ingresar a desambiguacion de ciudades
|
28
|
+
def generate_url_disambiguation_city()
|
29
|
+
return @host + "/shop/flights/search/roundtrip/" + @path.gsub(/(\D{3})\/(\D{3})\//,"___/___/") + "?toDescriptions=test1&fromDescriptions=test2"
|
42
30
|
end
|
43
31
|
|
44
|
-
|
45
|
-
|
46
|
-
|
32
|
+
#genero una url para una busqueda anticipada
|
33
|
+
def generate_url_anticipated_search()
|
34
|
+
return @host + "/shop/flights/test/data/search/begin/roundtrip/" + @path
|
47
35
|
end
|
48
36
|
|
49
|
-
|
37
|
+
#genero la url de resultados de landing a partir de una ciudad de salida y una ciudad de destino
|
38
|
+
def generate_url_landing_search(dep,ret)
|
50
39
|
landing = (@site == "BR" ? "/passagens-aereas" : "/vuelos")
|
51
40
|
return @host + landing + "/#{dep}/#{ret}"
|
52
41
|
end
|
53
42
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
43
|
+
#genero la url para ingresar a la home de vuelos
|
44
|
+
def generate_url_landing_home()
|
45
|
+
landing = (@site == "BR" ? "/passagens-aereas" : "/vuelos")
|
46
|
+
return @host + landing
|
47
|
+
end
|
48
|
+
|
49
|
+
def get_advanced_bussinnes()
|
50
|
+
return "/NA/NA/C/NA/NA"
|
51
|
+
end
|
58
52
|
|
59
53
|
def get_indec_airlines(env)
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
end
|
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
|
+
end
|
69
62
|
|
70
|
-
|
71
|
-
|
72
|
-
|
63
|
+
def get_to_city_description()
|
64
|
+
return @city_to_1.name.no_accents
|
65
|
+
end
|
73
66
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
67
|
+
def add_day_to_search()
|
68
|
+
@date_from_1 = @date_from_1 + 1
|
69
|
+
@date_to_1 = @date_to_1 + 1
|
70
|
+
@path = "#{@city_from_1.code}/#{@city_to_1.code}/#{@date_from_1}/#{@date_to_1}/#{passengers}"
|
71
|
+
end
|
79
72
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
73
|
+
def set_new_date(date_from,date_to)
|
74
|
+
@date_from_1 = date_from
|
75
|
+
@date_to_1 = date_to
|
76
|
+
@path = "#{@city_from_1.code}/#{@city_to_1.code}/#{@date_from_1}/#{@date_to_1}/#{passengers}"
|
77
|
+
end
|
85
78
|
|
86
79
|
end
|
data/lib/mock_search.rb
CHANGED
@@ -10,6 +10,7 @@ class MockSearch
|
|
10
10
|
@cabotage = (cabotage=='true')
|
11
11
|
end
|
12
12
|
|
13
|
+
#genero el host de la url a la cual nos vamos a conectar, se genera a partir del pais y ambiente enviados como parametros.
|
13
14
|
def generar_host(site,env)
|
14
15
|
host = YAML.load(File.open("features/data/host.yml"))
|
15
16
|
return host[site][env]
|
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.15' #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.15'
|
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-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: geminabox
|