@@ -1334,15 +1334,15 @@ require "test_helper"
1334
1334
class BlogFlowTest < ActionDispatch::IntegrationTest
1335
1335
test "can see the welcome page" do
1336
1336
get "/"
1337
- assert_selector "h1", "Welcome#index"
1337
+ assert_select "h1", "Welcome#index"
1338
1338
end
1339
1339
end
1340
1340
` ` `
1341
1341
1342
1342
If you visit the root path, you should see `welcome/index.html.erb` rendered for
1343
1343
the view. So this assertion should pass.
1344
1344
1345
- NOTE : The assertion `assert_selector ` is available in integration tests to check
1345
+ NOTE : The assertion `assert_select ` is available in integration tests to check
1346
1346
the presence of key HTML elements and their content. It is similar to
1347
1347
` assert_dom` , which should be used when [testing views](#testing-views) as
1348
1348
outlined in the section below.
@@ -1439,7 +1439,7 @@ class UsersTest < ApplicationSystemTestCase
1439
1439
# test "visiting the index" do
1440
1440
# visit users_url
1441
1441
#
1442
- # assert_selector "h1", text: "Users"
1442
+ # assert_select "h1", text: "Users"
1443
1443
# end
1444
1444
end
1445
1445
` ` `
@@ -1578,7 +1578,7 @@ require "application_system_test_case"
1578
1578
class ArticlesTest < ApplicationSystemTestCase
1579
1579
test "viewing the index" do
1580
1580
visit articles_path
1581
- assert_selector "h1", text: "Articles"
1581
+ assert_select "h1", text: "Articles"
1582
1582
end
1583
1583
end
1584
1584
` ` `
@@ -1654,7 +1654,7 @@ require "mobile_system_test_case"
1654
1654
class PostsTest < MobileSystemTestCase
1655
1655
test "visiting the index" do
1656
1656
visit posts_url
1657
- assert_selector "h1", text: "Posts"
1657
+ assert_select "h1", text: "Posts"
1658
1658
end
1659
1659
end
1660
1660
` ` `
@@ -1671,7 +1671,7 @@ which can be used in system tests.
1671
1671
| `assert_current_path(string, **options)` | Asserts that the page has the given path. |
1672
1672
| `assert_field(locator = nil, **options, &optional_filter_block)` | Checks if the page has a form field with the given label, name or id. |
1673
1673
| `assert_link(locator = nil, **options, &optional_filter_block)` | Checks if the page has a link with the given text or id. |
1674
- | `assert_selector (*args, &optional_filter_block)` | Asserts that a given selector is on the page. |
1674
+ | `assert_select (*args, &optional_filter_block)` | Asserts that a given selector is on the page. |
1675
1675
| `assert_table(locator = nil, **options, &optional_filter_block` | Checks if the page has a table with the given id or caption. |
1676
1676
| `assert_text(type, text, **options)` | Asserts that the page has the given text content. |
1677
1677
0 commit comments