rao-shoulda_matchers 0.0.49.pre → 0.0.51.pre
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 +4 -4
- data/lib/rao/shoulda/matchers/implement_create_action_matcher.rb +6 -3
- data/lib/rao/shoulda/matchers/implement_delete_action_matcher.rb +2 -2
- data/lib/rao/shoulda/matchers/implement_index_action_matcher.rb +1 -2
- data/lib/rao/shoulda/matchers/implement_show_action_matcher.rb +1 -2
- data/lib/rao/shoulda/matchers/implement_update_action_matcher.rb +7 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f1364c3e8a62a49337617ccf5cde70fcb61b96fe0e960c446bfb007d24ff401
|
4
|
+
data.tar.gz: 35417f1be3ac5bfcf55cbaaf154dadc38e9c17599b2eb7f17e23417834f68671
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2a8273fdd89667c0a38d2fcfe13b14ac63b387591273cb5081dbab82a00c286a32dc161bfc3440790afed72808c931c2a9194e9acf8017ca36813ba684eccc4
|
7
|
+
data.tar.gz: 07e0aa8e6ac44ec3ca21d4b6fe1cc2604f0a4084942cb6f7231d55fca06aa0ce80fdbab9fd03c435b1d3f5be4397edfac2f9d87b0e417cee171fe66b1e4b66bc
|
@@ -86,8 +86,7 @@ module Rao
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def matches?(base_path)
|
89
|
-
@base_path = @spec.class.name.split('::')[0..2].join('::').constantize.description
|
90
|
-
# @base_path = base_path
|
89
|
+
@base_path = @spec.respond_to?(:base_path) ? @spec.base_path : @spec.class.name.split('::')[0..2].join('::').constantize.description
|
91
90
|
@new_path = "#{@base_path}/new"
|
92
91
|
|
93
92
|
@spec.visit(@new_path)
|
@@ -95,7 +94,7 @@ module Rao
|
|
95
94
|
@before_count = @block.call(@resource_class)
|
96
95
|
@spec.within(@form_id) do
|
97
96
|
@form_block.call
|
98
|
-
|
97
|
+
submit_button.click
|
99
98
|
end
|
100
99
|
@after_count = @block.call(@resource_class)
|
101
100
|
|
@@ -155,6 +154,10 @@ module Rao
|
|
155
154
|
def description
|
156
155
|
"expose create action on #{@new_path}"
|
157
156
|
end
|
157
|
+
|
158
|
+
def submit_button
|
159
|
+
@spec.find('input[name="commit"]')
|
160
|
+
end
|
158
161
|
end
|
159
162
|
end
|
160
163
|
end
|
@@ -46,9 +46,9 @@ module Rao
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def matches?(base_path)
|
49
|
-
@base_path = @spec.class.name.split('::')[0..2].join('::').constantize.description
|
50
|
-
# @base_path = base_path
|
49
|
+
@base_path = @spec.respond_to?(:base_path) ? @spec.base_path : @spec.class.name.split('::')[0..2].join('::').constantize.description
|
51
50
|
@expected_path = @base_path
|
51
|
+
|
52
52
|
@show_path = "#{@base_path}/#{id}"
|
53
53
|
|
54
54
|
@spec.visit(@show_path)
|
@@ -21,8 +21,7 @@ module Rao
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def matches?(base_path)
|
24
|
-
@base_path = @spec.class.name.split('::')[0..2].join('::').constantize.description
|
25
|
-
# @base_path = base_path
|
24
|
+
@base_path = @spec.respond_to?(:base_path) ? @spec.base_path : @spec.class.name.split('::')[0..2].join('::').constantize.description
|
26
25
|
|
27
26
|
@spec.visit(@base_path)
|
28
27
|
has_correct_status_code && has_correct_current_path
|
@@ -31,8 +31,7 @@ module Rao
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def matches?(base_path)
|
34
|
-
@base_path = @spec.class.name.split('::')[0..2].join('::').constantize.description
|
35
|
-
# @base_path = base_path
|
34
|
+
@base_path = @spec.respond_to?(:base_path) ? @spec.base_path : @spec.class.name.split('::')[0..2].join('::').constantize.description
|
36
35
|
@expected_path = "#{@base_path}/#{id}"
|
37
36
|
|
38
37
|
@spec.visit(@expected_path)
|
@@ -79,8 +79,8 @@ module Rao
|
|
79
79
|
end
|
80
80
|
|
81
81
|
def matches?(base_path)
|
82
|
-
@base_path = @spec.class.name.split('::')[0..2].join('::').constantize.description
|
83
|
-
|
82
|
+
@base_path = @spec.respond_to?(:base_path) ? @spec.base_path : @spec.class.name.split('::')[0..2].join('::').constantize.description
|
83
|
+
|
84
84
|
@show_path = "#{@base_path}/#{id}"
|
85
85
|
@edit_path = "#{@base_path}/#{id}/edit"
|
86
86
|
|
@@ -92,7 +92,7 @@ module Rao
|
|
92
92
|
|
93
93
|
@spec.within(@form_id) do
|
94
94
|
@form_block.call
|
95
|
-
|
95
|
+
submit_button.click
|
96
96
|
end
|
97
97
|
|
98
98
|
@resource.reload
|
@@ -182,6 +182,10 @@ module Rao
|
|
182
182
|
def description
|
183
183
|
"expose update action on #{@edit_path}"
|
184
184
|
end
|
185
|
+
|
186
|
+
def submit_button
|
187
|
+
@spec.find('input[name="commit"]')
|
188
|
+
end
|
185
189
|
end
|
186
190
|
end
|
187
191
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rao-shoulda_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.51.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roberto Vasquez Angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rao
|
@@ -316,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
316
|
- !ruby/object:Gem::Version
|
317
317
|
version: 1.3.1
|
318
318
|
requirements: []
|
319
|
-
rubygems_version: 3.4.
|
319
|
+
rubygems_version: 3.4.21
|
320
320
|
signing_key:
|
321
321
|
specification_version: 4
|
322
322
|
summary: Additional shoulda matchers for Ruby on Rails.
|