Sha256: 2fcc1833ee4ccdf0a2dbe142e673eccf427dcd635fe9cc126efdc1123069c521

Contents?: true

Size: 952 Bytes

Versions: 4

Compression:

Stored size: 952 Bytes

Contents

require 'test_helper'

class BooksControllerTest < ActionController::TestCase
  def test_should_get_index
    get :index
    assert_response :success
    assert_not_nil assigns(:books)
  end

  def test_should_get_new
    get :new
    assert_response :success
  end

  def test_should_create_book
    assert_difference('Book.count') do
      post :create, :book => { }
    end

    assert_redirected_to book_path(assigns(:book))
  end

  def test_should_show_book
    get :show, :id => books(:one).id
    assert_response :success
  end

  def test_should_get_edit
    get :edit, :id => books(:one).id
    assert_response :success
  end

  def test_should_update_book
    put :update, :id => books(:one).id, :book => { }
    assert_redirected_to book_path(assigns(:book))
  end

  def test_should_destroy_book
    assert_difference('Book.count', -1) do
      delete :destroy, :id => books(:one).id
    end

    assert_redirected_to books_path
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dm-rest-adapter-0.9.9 fixtures/book_service/test/functional/books_controller_test.rb
dm-rest-adapter-0.9.10 fixtures/book_service/test/functional/books_controller_test.rb
dm-rest-adapter-0.9.7 fixtures/book_service/test/functional/books_controller_test.rb
dm-rest-adapter-0.9.8 fixtures/book_service/test/functional/books_controller_test.rb