aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2015-03-24 21:04:24 +0100
committerKasper Timm Hansen <kaspth@gmail.com>2015-03-24 21:25:38 +0100
commitc8ca20f7a0fc299cacf5c80e000dd56d4ceb7400 (patch)
tree0b8ba7bea3a69bc593d623802d29de442b14cde5 /guides
parentb6b088429c945b5c0c213fcdb9b4f6658faf686a (diff)
downloadrails-c8ca20f7a0fc299cacf5c80e000dd56d4ceb7400.tar.gz
rails-c8ca20f7a0fc299cacf5c80e000dd56d4ceb7400.tar.bz2
rails-c8ca20f7a0fc299cacf5c80e000dd56d4ceb7400.zip
[ci skip] Update 4.2 Release notes with more assert_select information.
Adds documentation for substitutions and why Regexp substitions look different when assertion fails.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/4_2_release_notes.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/guides/source/4_2_release_notes.md b/guides/source/4_2_release_notes.md
index 366d9d26b4..b7ab374c8b 100644
--- a/guides/source/4_2_release_notes.md
+++ b/guides/source/4_2_release_notes.md
@@ -302,6 +302,30 @@ application is using any of these spellings, you will need to update them:
assert_select('p', 'AT&amp;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
--------