rao-shoulda_matchers 0.0.49.pre → 0.0.50.pre

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
  SHA256:
3
- metadata.gz: c8ce7b7089243c233bcaedae66865939cc2e0fae6cd63b0decff7f24872b7aa2
4
- data.tar.gz: 4b72364c205f481bd5e0ad7387d1cb9a598de730c29cbc2a19a4ebdd840241ea
3
+ metadata.gz: e9c8cac562aeb675070d8bf7a2f277a2e2b17886bb4984b188d93c12aeacd643
4
+ data.tar.gz: 504116728bbddfc6bf2cd770e7977ad3c1d20a2485751649c1fbe4725db021ac
5
5
  SHA512:
6
- metadata.gz: 4d8e60c12b105b055bf9abdddae1518ce666da8fce4d7b40db7805f3b3c292a5fd7df27f9f8e29697e854403c21e0171229217cedab35f3660b91a5c77424e01
7
- data.tar.gz: 690061cfb3b5e4a8193c099205f743a0f3df69f4a3e027a9026333fb9bddbc7c65b827693ab04552edeaac7d1323f44bce42f09d55adfe66270b51af8787ffc6
6
+ metadata.gz: 9e0d2863b2a733d28f0f207aef8de674aa797662a8770fbd7eda4a0849c98bc345ebba19070f85e18dd1754ff9caddd014faea01027e5c951685b3dc4359dc8a
7
+ data.tar.gz: 1ff1ef0048b8d8f893e35bfe0dc3bdb3ca3884868e5450a1e85b15e10fd7d27a1f0ae6a96d2541bbb33c3231a0a59869ef26c2257dbf64ddfd422cdde7461d5d
@@ -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
- @spec.find('input[name="commit"]').click
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
- # @base_path = base_path
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
- @spec.find('input[name="commit"]').click
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.49.pre
4
+ version: 0.0.50.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-04-11 00:00:00.000000000 Z
11
+ date: 2023-10-16 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.11
319
+ rubygems_version: 3.4.20
320
320
  signing_key:
321
321
  specification_version: 4
322
322
  summary: Additional shoulda matchers for Ruby on Rails.