scrivener_errors 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 016d5a3108de8581c6b9cd88e3c812a43d3a6f08
4
- data.tar.gz: 3085e7f26acd7ba51e55bdb43bcaa6a40a06de53
3
+ metadata.gz: fe0b9e26051ed12937cef5a124871ea6bb8a89ff
4
+ data.tar.gz: 491fddb121f4f4b27814966df0378c0cf080bfb7
5
5
  SHA512:
6
- metadata.gz: c37510e2cb059bf3e008558d7900cfc835775babbae35d4c36940fd6b139140f78a9124e8e1815faa36eda70a7c9defd0c7bc07fde10c82088f59709fdf78c1b
7
- data.tar.gz: ffe5c0fa4217bbc5c28575def83d8b115b235fbdb6ed60eba58e71122d00029cb524ae68e245bc15df61e7ec7881efdb149eafc4ecab14c2f78c0ef2aa3346d0
6
+ metadata.gz: cacf2a21d8cbb1197876194853dd273dcc2f5998d9a72b01066008c52290070afad5354c89542eea483af0274675f7b8c4d7b27be9b73923b782bdc189cf49b3
7
+ data.tar.gz: 5f0a102ff76696a734e70695c87aa70c6f46e6a979af093f07d4389d1f00177b5a450e1eab53c7f5fad7583d1fae24daa731a8f73d8791fa618656d76ddd49d0
@@ -23,7 +23,9 @@ class ScrivenerErrors
23
23
  end
24
24
 
25
25
  def [](att)
26
- if (errors = scrivener.errors[att.to_sym])
26
+ errors = scrivener.errors[att.to_sym]
27
+
28
+ if errors.length > 0
27
29
  errors.map { |e| lookup(e) }.join(', ')
28
30
  end
29
31
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "scrivener_errors"
3
- s.version = "0.0.5"
3
+ s.version = "0.0.6"
4
4
  s.summary = "Basic error messages for Scrivener filters"
5
5
  s.description = s.summary
6
6
  s.authors = ["Brendon Murphy"]
@@ -71,6 +71,14 @@ scope do
71
71
  "has invalid length, is invalid",
72
72
  ScrivenerErrors.new(filter)[:password])
73
73
  end
74
+
75
+ test "returning nil when an attribute has no errors" do
76
+ filter = SignUp.new(email: 'john@example.com',
77
+ password: ' x',
78
+ password_confirmation: 'y')
79
+
80
+ assert_equal(nil, ScrivenerErrors.new(filter)[:email])
81
+ end
74
82
  end
75
83
 
76
84
  scope do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivener_errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brendon Murphy