salestation 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/salestation/rspec/glia_input_validation_error_matcher.rb +16 -1
- data/salestation.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45624d622f8661658f1549308516bf9600bad88764a1e6682ea9e585c95be059
|
4
|
+
data.tar.gz: b10067eda3d00fd6da5648f0a396f558e8c6122968b8393e6934fd7053a34e6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7eb34e5d245f616f9db8e8a64f3df426ea80982bd44a00933cb681b5c1fc5e818e4b8b6ff7dcdf177f841448fd50d8ccf1eeb62a65619fceb5cd25e893007966
|
7
|
+
data.tar.gz: a6c636b8b308f57a2c23c99d63a2099b05f6dc89e133caa29f98a35920d971cd9e3905176c1075fa891e4442d164be9050f8e57f3ef0c91f6bd7021d3170a423
|
@@ -12,6 +12,7 @@ module Salestation
|
|
12
12
|
def initialize
|
13
13
|
@fields = []
|
14
14
|
@field_error_types = {}
|
15
|
+
@field_error_messages = {}
|
15
16
|
end
|
16
17
|
|
17
18
|
def on(field)
|
@@ -24,10 +25,16 @@ module Salestation
|
|
24
25
|
self
|
25
26
|
end
|
26
27
|
|
28
|
+
def with_message(*messages)
|
29
|
+
@field_error_messages[@fields.last] = messages
|
30
|
+
self
|
31
|
+
end
|
32
|
+
|
27
33
|
def matches?(actual)
|
28
34
|
@fields.all? do |field|
|
29
35
|
check_field_exists(field, actual) &&
|
30
|
-
check_field_error_types(field, actual)
|
36
|
+
check_field_error_types(field, actual) &&
|
37
|
+
check_field_error_messages(field, actual)
|
31
38
|
end
|
32
39
|
end
|
33
40
|
|
@@ -44,6 +51,14 @@ module Salestation
|
|
44
51
|
|
45
52
|
(@field_error_types[field] - actual_error_types).empty?
|
46
53
|
end
|
54
|
+
|
55
|
+
def check_field_error_messages(field, actual)
|
56
|
+
return true unless @field_error_messages[field]
|
57
|
+
|
58
|
+
actual_error_messages = actual[:error_details].fetch(field).map { |f| f.fetch(:message) }
|
59
|
+
|
60
|
+
(@field_error_messages[field] - actual_error_messages).empty?
|
61
|
+
end
|
47
62
|
end
|
48
63
|
end
|
49
64
|
end
|
data/salestation.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: salestation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Glia TechMovers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|