require 'test_helper'

class DeliveryDestinationsControllerTest < ActionController::TestCase
  setup do
    @delivery_destination = delivery_destinations(:one)
  end

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

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

  test "should create delivery_destination" do
    assert_difference('DeliveryDestination.count') do
      post :create, delivery_destination: { address: @delivery_destination.address, email: @delivery_destination.email, name: @delivery_destination.name, note: @delivery_destination.note, phone: @delivery_destination.phone, place: @delivery_destination.place, postal_code: @delivery_destination.postal_code }
    end

    assert_redirected_to delivery_destination_path(assigns(:delivery_destination))
  end

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

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

  test "should update delivery_destination" do
    patch :update, id: @delivery_destination, delivery_destination: { address: @delivery_destination.address, email: @delivery_destination.email, name: @delivery_destination.name, note: @delivery_destination.note, phone: @delivery_destination.phone, place: @delivery_destination.place, postal_code: @delivery_destination.postal_code }
    assert_redirected_to delivery_destination_path(assigns(:delivery_destination))
  end

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

    assert_redirected_to delivery_destinations_path
  end
end
