Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci skip] Update 4.2 Release notes with more assert_select information. #19502

Merged
merged 1 commit into from
Mar 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions guides/source/4_2_release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,30 @@ application is using any of these spellings, you will need to update them:
assert_select('p', 'AT&T') # => false
```

Furthermore substitutions have changed syntax.

Now you have to use a `:match` CSS-like selector:

```ruby
assert_select ":match('id', ?)", 'comment_1'
```

Additionally Regexp substitutions look different when the assertion fails.
Notice how `/hello/` here:

```ruby
assert_select(":match('id', ?)", /hello/)
```

becomes `"(?-mix:hello)"`:

```
Expected at least 1 element matching "div:match('id', "(?-mix:hello)")", found 0..
Expected 0 to be >= 1.
```

See the [Rails Dom Testing](https://github.com/rails/rails-dom-testing/tree/8798b9349fb9540ad8cb9a0ce6cb88d1384a210b) documentation for more on `assert_select`.


Railties
--------
Expand Down