created delivery destination model

This commit is contained in:
Senad Uka
2015-02-20 07:33:26 +01:00
parent 47017b6830
commit 53fc9f0b99
10 changed files with 123 additions and 3 deletions

View File

@@ -0,0 +1,49 @@
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