committee 2.0.0.pre4 → 2.0.0.pre5

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
  SHA1:
3
- metadata.gz: ba1386b19ed18bfad94a7306dc91adecd1df8986
4
- data.tar.gz: 65543870a13c61dd5077f06865690c5f21fdae94
3
+ metadata.gz: b8ffc44027f6147a34b278d70e7f20117fa9cf93
4
+ data.tar.gz: 068dec170ff98a7e06e88372f396adcae0b3934a
5
5
  SHA512:
6
- metadata.gz: e9ffac6d7c7f874b7e15701ad1a20a531a9bc6204aa61337c410f8d3fb0db077f30d5bc8e8c1aadb65ba37944399affbd7522ea6439638648d05c3bcd363ba66
7
- data.tar.gz: 29b5db2813226fd23f7db76aa76cc01a744b64d2f6c00e317cadfc52dddad76ef6cd48dd8f68781bdbdde414295431bedf7c8f9f79648a3f592a1a65583cf183
6
+ metadata.gz: 457ab6c2e9c8206208d9f4960ffaeba6f82d416a286116ed36cea327ff873cf5bf217493a71cb7edf46991c05a8ae646719af6d1f7471a9d8805637beab6577f
7
+ data.tar.gz: e8a55c657884295a59ed2559c5e1017c428d037c75df1eb27fa62516c4630b24222722b784b94d2f76fff47abe1332f65e73c4410b9c32d5dfdc4ffd1156ec9f
@@ -9,6 +9,8 @@ module Committee
9
9
 
10
10
  def call
11
11
  coerced = {}
12
+ return coerced unless @schema.respond_to?(:properties)
13
+
12
14
  @schema.properties.each do |k, s|
13
15
  original_val = @params[k]
14
16
 
@@ -17,7 +17,7 @@ describe Committee::Middleware::RequestValidation do
17
17
  assert_equal 200, last_response.status
18
18
  end
19
19
 
20
- it "pass datetime string and coerce_date_times option enable" do
20
+ it "passes given a datetime and with coerce_date_times enabled" do
21
21
  @app = new_rack_app(coerce_date_times: true, schema: hyper_schema)
22
22
  params = {
23
23
  "update_time" => "2016-04-01T16:00:00.000+09:00"
@@ -27,7 +27,7 @@ describe Committee::Middleware::RequestValidation do
27
27
  assert_equal 200, last_response.status
28
28
  end
29
29
 
30
- it "pass invalid datetime string and coerce_date_times option enable" do
30
+ it "passes given an invalid datetime string with coerce_date_times enabled" do
31
31
  @app = new_rack_app(coerce_date_times: true, schema: hyper_schema)
32
32
  params = {
33
33
  "update_time" => "invalid_datetime_format"
@@ -38,6 +38,13 @@ describe Committee::Middleware::RequestValidation do
38
38
  assert_match /invalid request/i, last_response.body
39
39
  end
40
40
 
41
+ it "passes with coerce_date_times enabled and without a schema for a link" do
42
+ @app = new_rack_app(coerce_date_times: true, schema: hyper_schema)
43
+ header "Content-Type", "application/json"
44
+ get "/apps", JSON.generate({})
45
+ assert_equal 200, last_response.status
46
+ end
47
+
41
48
  it "detects an invalid request" do
42
49
  @app = new_rack_app(schema: hyper_schema)
43
50
  header "Content-Type", "application/json"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: committee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre4
4
+ version: 2.0.0.pre5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandur
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-12-06 00:00:00.000000000 Z
12
+ date: 2017-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_schema