created item groups and link banners and their associations and fixed bugs with join tables

This commit is contained in:
Senad Uka
2015-03-22 06:17:05 +01:00
parent 38548e3e33
commit bbedb4a877
20 changed files with 219 additions and 81 deletions

View File

@@ -0,0 +1,49 @@
require 'test_helper'
class ItemGroupsControllerTest < ActionController::TestCase
setup do
@item_group = item_groups(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:item_groups)
end
test "should get new" do
get :new
assert_response :success
end
test "should create item_group" do
assert_difference('ItemGroup.count') do
post :create, item_group: { description: @item_group.description, name: @item_group.name, visible: @item_group.visible }
end
assert_redirected_to item_group_path(assigns(:item_group))
end
test "should show item_group" do
get :show, id: @item_group
assert_response :success
end
test "should get edit" do
get :edit, id: @item_group
assert_response :success
end
test "should update item_group" do
patch :update, id: @item_group, item_group: { description: @item_group.description, name: @item_group.name, visible: @item_group.visible }
assert_redirected_to item_group_path(assigns(:item_group))
end
test "should destroy item_group" do
assert_difference('ItemGroup.count', -1) do
delete :destroy, id: @item_group
end
assert_redirected_to item_groups_path
end
end