require 'test_helper'

class AclGroupsControllerTest < ActionController::TestCase
  setup do
    @acl_group = acl_groups(:one)
  end

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

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

  test "should create acl_group" do
    assert_difference('AclGroup.count') do
      post :create, acl_group: { group_name: @acl_group.group_name, location_network_id: @acl_group.location_network_id, organisation_id: @acl_group.organisation_id, router_inventory_id: @acl_group.router_inventory_id }
    end

    assert_redirected_to acl_group_path(assigns(:acl_group))
  end

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

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

  test "should update acl_group" do
    patch :update, id: @acl_group, acl_group: { group_name: @acl_group.group_name, location_network_id: @acl_group.location_network_id, organisation_id: @acl_group.organisation_id, router_inventory_id: @acl_group.router_inventory_id }
    assert_redirected_to acl_group_path(assigns(:acl_group))
  end

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

    assert_redirected_to acl_groups_path
  end
end
