Sha256: 86db3dd40eea48a99468cc3c4088be78f8a8b81f629248ffcb52881f2aa715a4

Contents?: true

Size: 1.09 KB

Versions: 14

Compression:

Stored size: 1.09 KB

Contents

require 'test_helper'

class ProductsControllerTest < ActionController::TestCase
  setup do
    @product = products(:one)
  end

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

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

  test "should create product" do
    assert_difference('Product.count') do
      post :create, product: { description: @product.description, name: @product.name }
    end

    assert_redirected_to product_path(assigns(:product))
  end

  test "should show product" do
    get :show, id: @product
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @product
    assert_response :success
  end

  test "should update product" do
    put :update, id: @product, product: { description: @product.description, name: @product.name }
    assert_redirected_to product_path(assigns(:product))
  end

  test "should destroy product" do
    assert_difference('Product.count', -1) do
      delete :destroy, id: @product
    end

    assert_redirected_to products_path
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
crimagify-0.0.4.3 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.4.2 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.4.1 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.4.0 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.3.9 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.3.8 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.3.6 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.3.5 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.3.4 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.3.3 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.3.2 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.3.1 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.2.1 test/dummy/test/functional/products_controller_test.rb
crimagify-0.0.2 test/dummy/test/functional/products_controller_test.rb