glib-web 0.5.1 → 0.5.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 030e8fab91840b4a4337ebb8e867f56b9b658ec8932716afae41f1ebb84f93ee
|
4
|
+
data.tar.gz: 1dc8364b2e509891eeed48c55f4aa8f9d8c89c3b9dad8dc700720d14e2b55e15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c94b19ff196e16ed430d973f295b64a4aa92e4a89f685e74731e5ecadb0a23a3ea39ab7aafe049e7bff46ffadb4d67f59d9a6b1791613cffcf63f66df611e806
|
7
|
+
data.tar.gz: 9175751c633b836d10cfc4aa67d4af2e4e7ea8b837a99dfc34bf6fe91efc3ddf932a1aa227d13097cfbdb5aaab63ca9ecdd14fd3410a114e926c2896e36c6df0
|
@@ -3,9 +3,9 @@ module Glib
|
|
3
3
|
class NavInitiate < ActionCrawler
|
4
4
|
def initialize(http, args, action)
|
5
5
|
super(http)
|
6
|
-
|
6
|
+
|
7
7
|
@http = http
|
8
|
-
if (json = @http.get args['url'], action) && (left_drawer = json['leftDrawer'])
|
8
|
+
if (json = (@http.get args['url'], action, args.except('url'))) && (left_drawer = json['leftDrawer'])
|
9
9
|
crawl left_drawer['header']&.[]('childViews')
|
10
10
|
crawl left_drawer['rows']
|
11
11
|
end
|
@@ -20,8 +20,8 @@ module Glib
|
|
20
20
|
@router = router
|
21
21
|
end
|
22
22
|
|
23
|
-
def get(url, action, inspect_result = true)
|
24
|
-
fetch(:get, url, action,
|
23
|
+
def get(url, action, params = {}, inspect_result = true)
|
24
|
+
fetch(:get, url, action, params, inspect_result)
|
25
25
|
end
|
26
26
|
|
27
27
|
def post(url, action, params)
|
@@ -65,6 +65,7 @@ module Glib
|
|
65
65
|
'Client-Version' => user[:version],
|
66
66
|
'X-CSRF-Token' => user[:token]
|
67
67
|
}
|
68
|
+
http_header.merge!(params[:headers]) if params[:headers].present?
|
68
69
|
|
69
70
|
params.each do |name, value|
|
70
71
|
params[name] = '' if value.is_a?(Array) && value.size == 0
|
@@ -99,7 +100,7 @@ module Glib
|
|
99
100
|
if (code = response.code) == 302
|
100
101
|
redirect_uri = URI(response.headers['Location'])
|
101
102
|
redirect_uri.query = [redirect_uri.query, 'format=json'].compact.join('&')
|
102
|
-
get redirect_uri.to_s, action
|
103
|
+
get redirect_uri.to_s, action, params
|
103
104
|
else
|
104
105
|
response_times << response.headers['X-Runtime'].to_f
|
105
106
|
@context.assert_includes VALID_RESPONSE_CODES, code, "Expected a valid response but was [#{response.code}] #{Rack::Utils::HTTP_STATUS_CODES[response.code.to_i]}:\n#{url}"
|
data/lib/glib/test_helpers.rb
CHANGED
@@ -13,7 +13,7 @@ module Glib
|
|
13
13
|
|
14
14
|
def __log_dir
|
15
15
|
if @__log_dir.nil?
|
16
|
-
@__log_dir = File.expand_path("controllers/#{self.class.to_s.underscore}_results", File.dirname(__FILE__))
|
16
|
+
@__log_dir = File.expand_path("#{Rails.root}/test/controllers/#{self.class.to_s.underscore}_results", File.dirname(__FILE__))
|
17
17
|
unless File.directory?(@__log_dir)
|
18
18
|
FileUtils.mkdir_p(@__log_dir)
|
19
19
|
end
|