Sha256: e73066e20bf5ee0e0af3c772c1933670720964d4eece7bc06d2807d785f3c675

Contents?: true

Size: 1 KB

Versions: 18

Compression:

Stored size: 1 KB

Contents

require 'test_helper'

class ItemsControllerTest < ActionController::TestCase
  setup do
    @item = items(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:items)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create item" do
    assert_difference('Item.count') do
      post :create, :item => @item.attributes
    end

    assert_redirected_to item_path(assigns(:item))
  end

  test "should show item" do
    get :show, :id => @item.to_param
    assert_response :success
  end

  test "should get edit" do
    get :edit, :id => @item.to_param
    assert_response :success
  end

  test "should update item" do
    put :update, :id => @item.to_param, :item => @item.attributes
    assert_redirected_to item_path(assigns(:item))
  end

  test "should destroy item" do
    assert_difference('Item.count', -1) do
      delete :destroy, :id => @item.to_param
    end

    assert_redirected_to items_path
  end
end

Version data entries

18 entries across 8 versions & 3 rubygems

Version Path
restfulie-nosqlite-1.0.4 full-examples/rest_from_scratch/part_3/test/functional/items_controller_test.rb
restfulie-nosqlite-1.0.4 full-examples/rest_from_scratch/part_1/test/functional/items_controller_test.rb
restfulie-nosqlite-1.0.4 full-examples/rest_from_scratch/part_2/test/functional/items_controller_test.rb
restfulie-1.1.1 full-examples/rest_from_scratch/part_1/test/functional/items_controller_test.rb
restfulie-1.1.1 full-examples/rest_from_scratch/part_2/test/functional/items_controller_test.rb
restfulie-1.1.1 full-examples/rest_from_scratch/part_3/test/functional/items_controller_test.rb
restfulie-1.1.0 full-examples/rest_from_scratch/part_1/test/functional/items_controller_test.rb
restfulie-1.1.0 full-examples/rest_from_scratch/part_2/test/functional/items_controller_test.rb
restfulie-1.1.0 full-examples/rest_from_scratch/part_3/test/functional/items_controller_test.rb
restfulie-nosqlite-1.0.3 full-examples/rest_from_scratch/part_1/test/functional/items_controller_test.rb
restfulie-nosqlite-1.0.3 full-examples/rest_from_scratch/part_3/test/functional/items_controller_test.rb
restfulie-nosqlite-1.0.3 full-examples/rest_from_scratch/part_2/test/functional/items_controller_test.rb
restfulie-1.0.3 full-examples/rest_from_scratch/part_1/test/functional/items_controller_test.rb
restfulie-1.0.3 full-examples/rest_from_scratch/part_2/test/functional/items_controller_test.rb
restfulie-1.0.3 full-examples/rest_from_scratch/part_3/test/functional/items_controller_test.rb
pushify-1.2.2 demos/rails3/test/functional/items_controller_test.rb
pushify-1.2.1 demos/rails3/test/functional/items_controller_test.rb
pushify-1.2.0 demos/rails3/test/functional/items_controller_test.rb