capybara_active_admin 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -2
- data/lib/capybara/active_admin/finders/attributes_table.rb +5 -0
- data/lib/capybara/active_admin/finders/form.rb +0 -9
- data/lib/capybara/active_admin/matchers/form.rb +0 -11
- data/lib/capybara/active_admin/selectors/form.rb +0 -14
- data/lib/capybara/active_admin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffad605d6aa8c00d8bd2c3e52a6e951965adca36ec416e73051793b163d83757
|
4
|
+
data.tar.gz: 68b2c38a0fe0ee8f711cad15982495e3d5f6680a284c65232d5ffefa05ae9aad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63dfa20b4d356d3759617a2c81ee57dd06bddc4beefdc3b4cdefa650a5a116687ec9ad108fbd494a6e83b1b0447f893175cc7b72f27438c48fc8d76ba060e8f7
|
7
|
+
data.tar.gz: 1b67771979a8b8ab0e255112bf585eb97611226b08fa258debc409042803a022d81a5b74539d1839b14011d2cbfc00ab5f7404c0092c458d11f9974a87a39af9
|
data/CHANGELOG.md
CHANGED
@@ -6,10 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
6
|
|
7
7
|
## [Unreleased]
|
8
8
|
|
9
|
+
## [0.3.1] - 2020-04-15
|
10
|
+
### Added
|
11
|
+
- `within_attribute_row` finder
|
12
|
+
|
13
|
+
### Removed
|
14
|
+
- `find_input` finder
|
15
|
+
- `have_input`, `have_no_input` matchers
|
16
|
+
- `input_selector` selector
|
17
|
+
|
9
18
|
## [0.3.0] - 2020-04-15
|
10
19
|
### Added
|
11
|
-
- implement DSL for tabs, batch actions, modal dialog, attributes table, panel, sidebar, footer
|
12
|
-
- improve form DSL
|
20
|
+
- implement DSL for tabs, batch actions, modal dialog, attributes table, panel, sidebar, footer
|
21
|
+
- improve form DSL
|
13
22
|
|
14
23
|
## [0.2.1] - 2020-04-14
|
15
24
|
### Fixed
|
@@ -11,6 +11,11 @@ module Capybara
|
|
11
11
|
selector = attributes_table_selector(model_name, record_id)
|
12
12
|
within(selector) { yield }
|
13
13
|
end
|
14
|
+
|
15
|
+
def within_attribute_row(label)
|
16
|
+
selector = attributes_row_selector(label)
|
17
|
+
within(selector) { yield }
|
18
|
+
end
|
14
19
|
end
|
15
20
|
end
|
16
21
|
end
|
@@ -22,15 +22,6 @@ module Capybara
|
|
22
22
|
within(fieldset) { yield }
|
23
23
|
end
|
24
24
|
|
25
|
-
def find_input(label, options = {})
|
26
|
-
label_opts = Util.options_with_text label, options.slice(:exact)
|
27
|
-
label_node = find(label_selector, label_opts)
|
28
|
-
|
29
|
-
input_id = label_node[:for]
|
30
|
-
opts = options.except(:exact)
|
31
|
-
find("##{input_id}", opts)
|
32
|
-
end
|
33
|
-
|
34
25
|
def within_filters
|
35
26
|
selector = filter_form_selector
|
36
27
|
within(selector) { yield }
|
@@ -28,21 +28,10 @@ module Capybara
|
|
28
28
|
have_selector(semantic_error_selector, options)
|
29
29
|
end
|
30
30
|
|
31
|
-
def have_no_input(text, options = {})
|
32
|
-
opts = Util.options_with_text(text, options)
|
33
|
-
have_none_of_selectors(:css, label_selector, opts)
|
34
|
-
end
|
35
|
-
|
36
31
|
def have_has_many_fields_for(association_name, options = {})
|
37
32
|
selector = has_many_fields_selector(association_name)
|
38
33
|
have_selector(selector, options)
|
39
34
|
end
|
40
|
-
|
41
|
-
def have_input(text, options = {})
|
42
|
-
selector = input_selector text, options.slice(:type, :text)
|
43
|
-
opts = options.except(:type, :text)
|
44
|
-
have_selector(selector, opts)
|
45
|
-
end
|
46
35
|
end
|
47
36
|
end
|
48
37
|
end
|
@@ -31,20 +31,6 @@ module Capybara
|
|
31
31
|
selector
|
32
32
|
end
|
33
33
|
|
34
|
-
def input_selector(label, options)
|
35
|
-
text = options.delete(:text)
|
36
|
-
type = options.delete(:type) || :text
|
37
|
-
|
38
|
-
label_opts = options.merge(text: label)
|
39
|
-
label = find(label_selector, label_opts)
|
40
|
-
|
41
|
-
input_id = label[:for]
|
42
|
-
tag_name = type.to_sym == :select ? 'select' : 'input'
|
43
|
-
selector = "#{tag_name}##{input_id}"
|
44
|
-
selector = %(#{selector}[value="#{text}"]) unless text.nil?
|
45
|
-
selector
|
46
|
-
end
|
47
|
-
|
48
34
|
def input_container_selector(label, exact: nil)
|
49
35
|
return 'li' if label.nil?
|
50
36
|
|