Sha256: 7e5a431dfe7bcf16e4cf611164dca902707ba55d15af2771fadb0ecb14ccbca1

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

require 'test_helper'

class GlobalResourcesControllerTest < ActionController::TestCase
  setup do
    @global_resource = global_resources(:one)
  end

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

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

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

    assert_redirected_to global_resource_path(assigns(:global_resource))
  end

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

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

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

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

    assert_redirected_to global_resources_path
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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