Sha256: 8d0ccf6d47cee3f5f9f191014ea775fb0a555498b64372dd209b0edff17fc936

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

require 'test_helper'

class StandaloneResourcesControllerTest < ActionController::TestCase
  setup do
    @standalone_resource = standalone_resources(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:standalone_resources)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create standalone_resource" do
    assert_difference('StandaloneResource.count') do
      post :create, standalone_resource: { description: @standalone_resource.description, name: @standalone_resource.name }
    end

    assert_redirected_to standalone_resource_path(assigns(:standalone_resource))
  end

  test "should show standalone_resource" do
    get :show, id: @standalone_resource
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @standalone_resource
    assert_response :success
  end

  test "should update standalone_resource" do
    put :update, id: @standalone_resource, standalone_resource: { description: @standalone_resource.description, name: @standalone_resource.name }
    assert_redirected_to standalone_resource_path(assigns(:standalone_resource))
  end

  test "should destroy standalone_resource" do
    assert_difference('StandaloneResource.count', -1) do
      delete :destroy, id: @standalone_resource
    end

    assert_redirected_to standalone_resources_path
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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