Commit f2a6f31
authored
sort query params in verified routes during tests (#6536)
By having the query parameters being serialized in order (during tests only)
when using VerifiedRoutes, we can make some test assertions, like e.g.
`assert_redirect/3` from Phoenix.Liveview, less brittle when the query params
are constructed dynamically in the backend and it's not easy to predict /
maintain exact query param order in tested urls.
This behaviour will be enabled in newly generated apps by default. For existing
apps, add the following to `confing/test.exs`
```elixir
config :phoenix,
sort_verified_routes_query_params: true
```1 parent 593d499 commit f2a6f31
File tree
5 files changed
+38
-5
lines changed- config
- installer/templates
- phx_single/config
- phx_umbrella/config
- lib/phoenix
- test/phoenix
5 files changed
+38
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
821 | 825 | | |
822 | 826 | | |
823 | 827 | | |
824 | | - | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
825 | 833 | | |
826 | 834 | | |
827 | 835 | | |
| |||
880 | 888 | | |
881 | 889 | | |
882 | 890 | | |
883 | | - | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
884 | 895 | | |
885 | 896 | | |
886 | | - | |
| 897 | + | |
887 | 898 | | |
888 | 899 | | |
889 | 900 | | |
890 | | - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
891 | 907 | | |
892 | 908 | | |
893 | 909 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
374 | 382 | | |
375 | 383 | | |
376 | 384 | | |
| |||
0 commit comments