created delivery destination model
This commit is contained in:
@@ -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
|
||||
19
back-office/test/fixtures/delivery_destinations.yml
vendored
Normal file
19
back-office/test/fixtures/delivery_destinations.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
address: MyString
|
||||
place: MyString
|
||||
postal_code: MyString
|
||||
phone: MyString
|
||||
email: MyString
|
||||
note: MyText
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
address: MyString
|
||||
place: MyString
|
||||
postal_code: MyString
|
||||
phone: MyString
|
||||
email: MyString
|
||||
note: MyText
|
||||
7
back-office/test/models/delivery_destination_test.rb
Normal file
7
back-office/test/models/delivery_destination_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class DeliveryDestinationTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
Reference in New Issue
Block a user