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