Skip to Main Content
Programming Phoenix
book

Programming Phoenix

by Chris McCord, Bruce Tate, Jose Valim
April 2016
Beginner to intermediate content levelBeginner to intermediate
300 pages
6h 58m
English
Pragmatic Bookshelf
Content preview from Programming Phoenix

Using Mix to Run Phoenix Tests

Whether you knew it or not, Phoenix has already been generating default tests for you, such as test/controllers/video_controller_test.exs. We can go ahead and remove that file since it’s built for generic REST actions, not the features we’ve specifically built into our controller. We’ve added user authentication, validations, and the like to our videos, so we’ll start fresh with our VideoController tests. Delete the test/controllers/video_controller_test.exs file now, and then let’s see where our test suite stands:

 $ ​​mix​​ ​​test
 ...
  1) test GET / (Rumbl.PageControllerTest)
  test/controllers/page_controller_test.exs:4
  Assertion with =~ failed
  code: html_response(conn, 200) =~ "Welcome to Phoenix!" ...
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

Programming Elm

Programming Elm

Jeremy Fairbank
Real-Time Phoenix

Real-Time Phoenix

Stephen Bussey

Publisher Resources

ISBN: 9781680501926Errata Page