rspec_model_validations 1.0.1 → 1.0.3
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: f72e0cca20e520d22613403073e1b5ab8ba74bfb8d6538f1d019d40b006ed7fa
|
4
|
+
data.tar.gz: 49a56433ea4378a9c4a14825434442f88c03980daf82d9b1ccacebdff1ce0d5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09455c67b4b235d069d4b8e8673622c6357277a289dbf2d61567dab5c45f84160f17ae01645e840856e44fc3ac0753390b91b8701ed842bb63b04f2fd32e1ef3'
|
7
|
+
data.tar.gz: 6a1197468487d9bda07e83f438ced0cc0bb117687707cb98fd76c54ec548fb950b10aaadcebf5b5fe4b9f8b4b9f7bc7a1eb93494ce48709d6c9fe8503c82702e
|
@@ -34,7 +34,7 @@ module RspecModelValidations::Matchers::Base
|
|
34
34
|
# @param model [ActiveModel::Model]
|
35
35
|
# @return [Array]
|
36
36
|
def attribute_errors model
|
37
|
-
model.
|
37
|
+
model.attributes = { @attribute => @on } if defined? @on
|
38
38
|
model.validate
|
39
39
|
model.errors.group_by_attribute[@attribute]&.map(&:type) || []
|
40
40
|
end
|
@@ -43,7 +43,7 @@ module RspecModelValidations::Matchers::Base
|
|
43
43
|
# Attribute must exist
|
44
44
|
# @param model [ActiveModel::Model]
|
45
45
|
# @return [Object]
|
46
|
-
def attribute_value model; model.
|
46
|
+
def attribute_value model; model.send @attribute end
|
47
47
|
|
48
48
|
# Format a matcher expected / got faillure message
|
49
49
|
# @param expected [String] expected part of the message
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_model_validations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Guego
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|