require 'test_helper'

class DeviceOperationsControllerTest < ActionController::TestCase
  setup do
    @device_operation = device_operations(:one)
  end

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

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

  test "should create device_operation" do
    assert_difference('DeviceOperation.count') do
      post :create, device_operation: { air_volumn: @device_operation.air_volumn, consume_time: @device_operation.consume_time, device_id: @device_operation.device_id, op_at: @device_operation.op_at, operation: @device_operation.operation, store_id: @device_operation.store_id, user_id: @device_operation.user_id, user_name: @device_operation.user_name, user_type: @device_operation.user_type }
    end

    assert_redirected_to device_operation_path(assigns(:device_operation))
  end

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

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

  test "should update device_operation" do
    patch :update, id: @device_operation, device_operation: { air_volumn: @device_operation.air_volumn, consume_time: @device_operation.consume_time, device_id: @device_operation.device_id, op_at: @device_operation.op_at, operation: @device_operation.operation, store_id: @device_operation.store_id, user_id: @device_operation.user_id, user_name: @device_operation.user_name, user_type: @device_operation.user_type }
    assert_redirected_to device_operation_path(assigns(:device_operation))
  end

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

    assert_redirected_to device_operations_path
  end
end
