Sha256: 3a72e57b525dee7496235489bd0350b8ae3a9213c3f5141ca70b79b465ea72e8

Contents?: true

Size: 1001 Bytes

Versions: 2

Compression:

Stored size: 1001 Bytes

Contents

require 'test_helper'

class KksControllerTest < ActionController::TestCase
  setup do
    @kk = kks(:one)
  end

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

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

  test "should create kk" do
    assert_difference('Kk.count') do
      post :create, kk: { name: @kk.name, price: @kk.price, qty: @kk.qty }
    end

    assert_redirected_to kk_path(assigns(:kk))
  end

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

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

  test "should update kk" do
    patch :update, id: @kk, kk: { name: @kk.name, price: @kk.price, qty: @kk.qty }
    assert_redirected_to kk_path(assigns(:kk))
  end

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

    assert_redirected_to kks_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simple_cart-0.0.5 spec/dummy/test/controllers/kks_controller_test.rb
simple_cart-0.0.4 spec/dummy/test/controllers/kks_controller_test.rb