Files
old-ribica/back-office/test/controllers/delivery_time_estimations_controller_test.rb
2015-03-21 06:30:18 +01:00

50 lines
1.5 KiB
Ruby

require 'test_helper'
class DeliveryTimeEstimationsControllerTest < ActionController::TestCase
setup do
@delivery_time_estimation = delivery_time_estimations(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:delivery_time_estimations)
end
test "should get new" do
get :new
assert_response :success
end
test "should create delivery_time_estimation" do
assert_difference('DeliveryTimeEstimation.count') do
post :create, delivery_time_estimation: { duration_in_days: @delivery_time_estimation.duration_in_days, name: @delivery_time_estimation.name }
end
assert_redirected_to delivery_time_estimation_path(assigns(:delivery_time_estimation))
end
test "should show delivery_time_estimation" do
get :show, id: @delivery_time_estimation
assert_response :success
end
test "should get edit" do
get :edit, id: @delivery_time_estimation
assert_response :success
end
test "should update delivery_time_estimation" do
patch :update, id: @delivery_time_estimation, delivery_time_estimation: { duration_in_days: @delivery_time_estimation.duration_in_days, name: @delivery_time_estimation.name }
assert_redirected_to delivery_time_estimation_path(assigns(:delivery_time_estimation))
end
test "should destroy delivery_time_estimation" do
assert_difference('DeliveryTimeEstimation.count', -1) do
delete :destroy, id: @delivery_time_estimation
end
assert_redirected_to delivery_time_estimations_path
end
end