added delivery costs to total / added ribica logo just for fun / added validation check when confirming delivery

This commit is contained in:
Senad Uka
2015-03-13 07:04:44 +01:00
parent e3abc09891
commit 648dee4636
17 changed files with 208 additions and 31 deletions

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class PlacesControllerTest < ActionController::TestCase
setup do
@place = places(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:places)
end
test "should get new" do
get :new
assert_response :success
end
test "should create place" do
assert_difference('Place.count') do
post :create, place: { delivery_price: @place.delivery_price, name: @place.name, postal_code: @place.postal_code }
end
assert_redirected_to place_path(assigns(:place))
end
test "should show place" do
get :show, id: @place
assert_response :success
end
test "should get edit" do
get :edit, id: @place
assert_response :success
end
test "should update place" do
patch :update, id: @place, place: { delivery_price: @place.delivery_price, name: @place.name, postal_code: @place.postal_code }
assert_redirected_to place_path(assigns(:place))
end
test "should destroy place" do
assert_difference('Place.count', -1) do
delete :destroy, id: @place
end
assert_redirected_to places_path
end
end

11
back-office/test/fixtures/places.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
postal_code: MyString
delivery_price: 9.99
name: MyString
two:
postal_code: MyString
delivery_price: 9.99
name: MyString

View File

@@ -0,0 +1,7 @@
require 'test_helper'
class PlaceTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end