Sha256: efe810acbd54b957488cd1db3310d076ddd583eabde103a0d225e8046fa5911c

Contents?: true

Size: 1.01 KB

Versions: 3

Compression:

Stored size: 1.01 KB

Contents

require "test_helper"

class BlocksControllerTest < ActionController::TestCase
  def block
    @block ||= blocks :one
  end

  def test_index
    get :index
    assert_response :success
    assert_not_nil assigns(:blocks)
  end

  def test_new
    get :new
    assert_response :success
  end

  def test_create
    assert_difference("Block.count") do
      post :create, block: { depth: block.depth, height: block.height, name: block.name, width: block.width }
    end

    assert_redirected_to block_path(assigns(:block))
  end

  def test_show
    get :show, id: block
    assert_response :success
  end

  def test_edit
    get :edit, id: block
    assert_response :success
  end

  def test_update
    put :update, id: block, block: { depth: block.depth, height: block.height, name: block.name, width: block.width }
    assert_redirected_to block_path(assigns(:block))
  end

  def test_destroy
    assert_difference("Block.count", -1) do
      delete :destroy, id: block
    end

    assert_redirected_to blocks_path
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bootbox_crud-0.2.1 test/dummy/test/controllers/blocks_controller_test.rb
bootbox_crud-0.2.0 test/dummy/test/controllers/blocks_controller_test.rb
bootbox_crud-0.1.1.7 test/dummy/test/controllers/blocks_controller_test.rb