Sha256: 6da32ab697455d7c7af2f9e2580e8c6f49fc7adf4d984742ac3ae34a5db21198

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alberich-0.2.0 test/dummy/test/functional/child_resources_controller_test.rb