@@ -8,31 +8,31 @@ def setup
8
8
end
9
9
10
10
test "filling in a rich-text area by ID" do
11
- assert_selector "trix-editor# message_content"
11
+ assert_selector :element , "trix-editor" , id : " message_content"
12
12
fill_in_rich_textarea "message_content" , with : "Hello world!"
13
13
assert_selector :field , "message[content]" , with : /Hello world!/ , type : "hidden"
14
14
end
15
15
16
16
test "filling in a rich-text area by placeholder" do
17
- assert_selector "trix-editor[ placeholder=' Your message here'] "
17
+ assert_selector :element , "trix-editor" , placeholder : " Your message here"
18
18
fill_in_rich_textarea "Your message here" , with : "Hello world!"
19
19
assert_selector :field , "message[content]" , with : /Hello world!/ , type : "hidden"
20
20
end
21
21
22
22
test "filling in a rich-text area by aria-label" do
23
- assert_selector "trix-editor[ aria-label=' Message content aria-label'] "
23
+ assert_selector :element , "trix-editor" , " aria-label" : " Message content aria-label"
24
24
fill_in_rich_textarea "Message content aria-label" , with : "Hello world!"
25
25
assert_selector :field , "message[content]" , with : /Hello world!/ , type : "hidden"
26
26
end
27
27
28
28
test "filling in a rich-text area by label" do
29
- assert_selector " label" , text : "Message content label"
29
+ assert_selector : label, "Message content label" , for : "message_content "
30
30
fill_in_rich_textarea "Message content label" , with : "Hello world!"
31
31
assert_selector :field , "message[content]" , with : /Hello world!/ , type : "hidden"
32
32
end
33
33
34
34
test "filling in a rich-text area by input name" do
35
- assert_selector "trix-editor[input]"
35
+ assert_selector :element , "trix-editor" , input : true
36
36
fill_in_rich_textarea "message[content]" , with : "Hello world!"
37
37
assert_selector :field , "message[content]" , with : /Hello world!/ , type : "hidden"
38
38
end
0 commit comments