Skip to content

Commit

Permalink
Update must_respond_with_redirect -> must_redirect_to
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaddox19 authored May 1, 2020
1 parent f76bec0 commit 629d179
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 08-rails/testing-db-in-controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe "create" do
post books_path, params: book_hash
}.must_differ 'Book.count', 1

must_respond_with :redirect
must_redirect_to books_path
end
end
```
Expand Down Expand Up @@ -104,7 +104,7 @@ We will also need to create a test in which the params are invalid or missing.
patch book_path(book.id), params: new_book_hash
}.wont_change "Book.count"
must_respond_with :redirect
must_redirect_to books_path
book = Book.find_by(id: id)
expect(book.title).must_equal new_book_hash[:book][:title]
Expand Down

0 comments on commit 629d179

Please sign in to comment.