Skip to content

Commit

Permalink
Corrected two typographical errors in the 'guides/testing/testing.md'…
Browse files Browse the repository at this point in the history
… file to improve documentation clarity and readability.
  • Loading branch information
bhavyansh001 authored and Gazler committed Sep 17, 2023
1 parent 2fc7fe7 commit e8f4b38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions guides/testing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ The second line says this is a case template. This is a ExUnit feature that allo

Now that we have made this module a case template, we can define callbacks that are invoked on certain occasions. The `using` callback defines code to be injected on every module that calls `use HelloWeb.ConnCase`. In this case, it starts by setting the `@endpoint` module attribute with the name of our endpoint.

Next, it wires up `:verified_routes` to allow use to use `~p` based paths in our test just like we do in the rest of our application to easily generate paths and URLs in our tests.
Next, it wires up `:verified_routes` to allow us to use `~p` based paths in our test just like we do in the rest of our application to easily generate paths and URLs in our tests.

Finally, we import [`Plug.Conn`](https://hexdocs.pm/plug/Plug.Conn.html), so all of the connection helpers available in controllers are also available in tests, and then imports [`Phoenix.ConnTest`](https://hexdocs.pm/phoenix/Phoenix.ConnTest.html). You can consult these modules to learn all functionality available.

Then our case template defines a `setup` block. The `setup` block will be called before test. Most of the setup block is on setting up the SQL Sandbox, which we will talk about it later. In the last line of the `setup` block, we will find this:
Then our case template defines a `setup` block. The `setup` block will be called before test. Most of the setup block is on setting up the SQL Sandbox, which we will talk about later. In the last line of the `setup` block, we will find this:

```elixir
{:ok, conn: Phoenix.ConnTest.build_conn()}
Expand Down

0 comments on commit e8f4b38

Please sign in to comment.