require 'test_helper' class ChildResourcesControllerTest < ActionController::TestCase setup do @child_resource = child_resources(:one) end test "should get index" do get :index assert_response :success assert_not_nil assigns(:child_resources) end test "should get new" do get :new assert_response :success end test "should create child_resource" do assert_difference('ChildResource.count') do post :create, child_resource: { description: @child_resource.description, name: @child_resource.name } end assert_redirected_to child_resource_path(assigns(:child_resource)) end test "should show child_resource" do get :show, id: @child_resource assert_response :success end test "should get edit" do get :edit, id: @child_resource assert_response :success end test "should update child_resource" do put :update, id: @child_resource, child_resource: { description: @child_resource.description, name: @child_resource.name } assert_redirected_to child_resource_path(assigns(:child_resource)) end test "should destroy child_resource" do assert_difference('ChildResource.count', -1) do delete :destroy, id: @child_resource end assert_redirected_to child_resources_path end end