created items and configured back office ui a bit

This commit is contained in:
Senad Uka
2015-01-18 10:24:15 +01:00
parent 6d1ac88a7f
commit d09bc71aae
32 changed files with 368 additions and 7 deletions

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class UnitsControllerTest < ActionController::TestCase
setup do
@unit = units(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:units)
end
test "should get new" do
get :new
assert_response :success
end
test "should create unit" do
assert_difference('Unit.count') do
post :create, unit: { name: @unit.name, short_name: @unit.short_name }
end
assert_redirected_to unit_path(assigns(:unit))
end
test "should show unit" do
get :show, id: @unit
assert_response :success
end
test "should get edit" do
get :edit, id: @unit
assert_response :success
end
test "should update unit" do
patch :update, id: @unit, unit: { name: @unit.name, short_name: @unit.short_name }
assert_redirected_to unit_path(assigns(:unit))
end
test "should destroy unit" do
assert_difference('Unit.count', -1) do
delete :destroy, id: @unit
end
assert_redirected_to units_path
end
end