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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8ce7b7089243c233bcaedae66865939cc2e0fae6cd63b0decff7f24872b7aa2
4
- data.tar.gz: 4b72364c205f481bd5e0ad7387d1cb9a598de730c29cbc2a19a4ebdd840241ea
3
+ metadata.gz: 8f1364c3e8a62a49337617ccf5cde70fcb61b96fe0e960c446bfb007d24ff401
4
+ data.tar.gz: 35417f1be3ac5bfcf55cbaaf154dadc38e9c17599b2eb7f17e23417834f68671
5
5
  SHA512:
6
- metadata.gz: 4d8e60c12b105b055bf9abdddae1518ce666da8fce4d7b40db7805f3b3c292a5fd7df27f9f8e29697e854403c21e0171229217cedab35f3660b91a5c77424e01
7
- data.tar.gz: 690061cfb3b5e4a8193c099205f743a0f3df69f4a3e027a9026333fb9bddbc7c65b827693ab04552edeaac7d1323f44bce42f09d55adfe66270b51af8787ffc6
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
- @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.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-04-11 00:00:00.000000000 Z
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.11
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.