Skip to Content
Phoenix Web Development
book

Phoenix Web Development

by Brandon Richey
April 2018
Beginner to intermediate content levelBeginner to intermediate
406 pages
9h 33m
English
Packt Publishing
Content preview from Phoenix Web Development

Updating our tests

This all looks good, but if we go back and write our tests, we're going to see a ton of failures! The reason for this is that when we were running around creating our fixtures for various tests, we never specified any values for password and password_confirmation, which is now a required value for us to be able to save any changeset. We'll start off by modifying test/vocial_web/controllers/user_controller_test.exs. The easiest thing to do to start with is setting a module attribute in VocialWeb.UserControllerTest that sets all of the valid creation parameters for a user now:

  @create_params %{    "username" => "test",    "email" => "test@test.com",    "password" => "test",    "password_confirmation" => "test"  }

Notice the addition ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Phoenix in Action

Phoenix in Action

Geoffrey Lessel
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781787284197Supplemental Content