Sha256: 310ed83d8471729cf6d2885bd87e1a37f6922e02eaee297261b8e6f7a3ff1786
Contents?: true
Size: 1.19 KB
Versions: 1
Compression:
Stored size: 1.19 KB
Contents
require 'test_helper' module Book class BooksControllerTest < ActionController::TestCase setup do @book = books(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:books) end test "should get new" do get :new assert_response :success end test "should create book" do assert_difference('Book.count') do post :create, book: { body: @book.body, summary: @book.summary, title: @book.title, writer: @book.writer } end assert_redirected_to book_path(assigns(:book)) end test "should show book" do get :show, id: @book assert_response :success end test "should get edit" do get :edit, id: @book assert_response :success end test "should update book" do put :update, id: @book, book: { body: @book.body, summary: @book.summary, title: @book.title, writer: @book.writer } assert_redirected_to book_path(assigns(:book)) end test "should destroy book" do assert_difference('Book.count', -1) do delete :destroy, id: @book end assert_redirected_to books_path end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
books-0.0.1 | test/functional/book/books_controller_test.rb |