rasti-web 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.ruby-version +1 -1
- data/.travis.yml +7 -10
- data/lib/rasti/web/request.rb +1 -1
- data/lib/rasti/web/version.rb +1 -1
- data/rasti-web.gemspec +1 -2
- data/spec/request_spec.rb +27 -13
- metadata +9 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d5105988210acdb104ba5ad0088ab6b79083d43e27f29769a77d12c23c8af81f
|
4
|
+
data.tar.gz: 4d046ecf2410d04a1a655575c502d8c9b335f761820137ee96ff04fe51319484
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 455368d0bd93f5c0b0a385a31165ecc089247d2c33359a328302556cb88201719c7103ded8a647cfbeda87badb280057e820d75eb9c178d7488c9f86375c6bb1
|
7
|
+
data.tar.gz: 8ab0436ee72e1a20f267cc2f7f87be68bffe46ce6438a870381ab94e4551e708c581841d1eda67d9de60445a5f2e598081d4c48e9f1499d87c2fdb6826bd08d3
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.5.7
|
data/.travis.yml
CHANGED
@@ -4,11 +4,12 @@ rvm:
|
|
4
4
|
- 2.0
|
5
5
|
- 2.1
|
6
6
|
- 2.2
|
7
|
-
- 2.3
|
8
|
-
- 2.4
|
9
|
-
- 2.5
|
10
|
-
- 2.6
|
11
|
-
-
|
7
|
+
- 2.3
|
8
|
+
- 2.4
|
9
|
+
- 2.5
|
10
|
+
- 2.6
|
11
|
+
- 2.7
|
12
|
+
- jruby-9.2.9.0
|
12
13
|
- ruby-head
|
13
14
|
- jruby-head
|
14
15
|
|
@@ -16,8 +17,4 @@ matrix:
|
|
16
17
|
fast_finish: true
|
17
18
|
allow_failures:
|
18
19
|
- rvm: ruby-head
|
19
|
-
- rvm: jruby-head
|
20
|
-
|
21
|
-
before_install:
|
22
|
-
- rvm all-gemsets do gem uninstall bundler -ax || true
|
23
|
-
- gem install bundler -v "< 2"
|
20
|
+
- rvm: jruby-head
|
data/lib/rasti/web/request.rb
CHANGED
data/lib/rasti/web/version.rb
CHANGED
data/rasti-web.gemspec
CHANGED
@@ -26,9 +26,8 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_dependency 'content-type', '~> 0.0'
|
27
27
|
spec.add_dependency 'class_ancestry_sort', '~> 0.1'
|
28
28
|
|
29
|
-
spec.add_development_dependency 'bundler', '~> 1.12'
|
30
29
|
spec.add_development_dependency 'rake', '~> 11.0'
|
31
|
-
spec.add_development_dependency 'minitest', '~> 5.0'
|
30
|
+
spec.add_development_dependency 'minitest', '~> 5.0', '< 5.11'
|
32
31
|
spec.add_development_dependency 'minitest-colorin', '~> 0.1'
|
33
32
|
spec.add_development_dependency 'minitest-line', '~> 0.6'
|
34
33
|
spec.add_development_dependency 'simplecov', '~> 0.12'
|
data/spec/request_spec.rb
CHANGED
@@ -30,24 +30,38 @@ describe Rasti::Web::Request do
|
|
30
30
|
request.params['lon'].must_equal '20'
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
env = Rack::MockRequest.env_for '/', input: '{"lat": 10, "lon": 20}', 'CONTENT_TYPE' => 'application/json'
|
33
|
+
describe 'Json body params' do
|
35
34
|
|
36
|
-
|
35
|
+
it 'Valid content type' do
|
36
|
+
env = Rack::MockRequest.env_for '/', input: '{"lat": 10, "lon": 20}', 'CONTENT_TYPE' => 'application/json'
|
37
37
|
|
38
|
-
|
39
|
-
request.params[:lat].must_equal 10
|
40
|
-
request.params['lon'].must_equal 20
|
41
|
-
end
|
38
|
+
request = Rasti::Web::Request.new env
|
42
39
|
|
43
|
-
|
44
|
-
|
40
|
+
request.json?.must_equal true
|
41
|
+
request.params[:lat].must_equal 10
|
42
|
+
request.params['lon'].must_equal 20
|
43
|
+
end
|
45
44
|
|
46
|
-
|
45
|
+
it 'Invalid content type' do
|
46
|
+
env = Rack::MockRequest.env_for '/', input: '{"lat": 10, "lon": 20}', 'CONTENT_TYPE' => 'other/type'
|
47
|
+
|
48
|
+
request = Rasti::Web::Request.new env
|
49
|
+
|
50
|
+
request.json?.must_equal false
|
51
|
+
request.params[:lat].must_be_nil
|
52
|
+
request.params['lon'].must_be_nil
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'Undefined content type' do
|
56
|
+
env = Rack::MockRequest.env_for '/', input: '{"lat": 10, "lon": 20}'
|
57
|
+
|
58
|
+
request = Rasti::Web::Request.new env
|
59
|
+
|
60
|
+
request.json?.must_equal false
|
61
|
+
request.params[:lat].must_be_nil
|
62
|
+
request.params['lon'].must_be_nil
|
63
|
+
end
|
47
64
|
|
48
|
-
request.wont_be :json?
|
49
|
-
request.params[:lat].must_be_nil
|
50
|
-
request.params['lon'].must_be_nil
|
51
65
|
end
|
52
66
|
|
53
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rasti-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -108,20 +108,6 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.1'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: bundler
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '1.12'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '1.12'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: rake
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,6 +129,9 @@ dependencies:
|
|
143
129
|
- - "~>"
|
144
130
|
- !ruby/object:Gem::Version
|
145
131
|
version: '5.0'
|
132
|
+
- - "<"
|
133
|
+
- !ruby/object:Gem::Version
|
134
|
+
version: '5.11'
|
146
135
|
type: :development
|
147
136
|
prerelease: false
|
148
137
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -150,6 +139,9 @@ dependencies:
|
|
150
139
|
- - "~>"
|
151
140
|
- !ruby/object:Gem::Version
|
152
141
|
version: '5.0'
|
142
|
+
- - "<"
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '5.11'
|
153
145
|
- !ruby/object:Gem::Dependency
|
154
146
|
name: minitest-colorin
|
155
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -299,8 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
299
291
|
- !ruby/object:Gem::Version
|
300
292
|
version: '0'
|
301
293
|
requirements: []
|
302
|
-
|
303
|
-
rubygems_version: 2.6.8
|
294
|
+
rubygems_version: 3.0.6
|
304
295
|
signing_key:
|
305
296
|
specification_version: 4
|
306
297
|
summary: Web blocks to build robust applications
|