require 'test_helper'

class FirmiesControllerTest < ActionController::TestCase
  setup do
    @firmy = firmies(:one)
  end

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

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

  test "should create firmy" do
    assert_difference('Firmy.count') do
      post :create, firmy: @firmy.attributes
    end

    assert_redirected_to firmy_path(assigns(:firmy))
  end

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

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

  test "should update firmy" do
    put :update, id: @firmy, firmy: @firmy.attributes
    assert_redirected_to firmy_path(assigns(:firmy))
  end

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

    assert_redirected_to firmies_path
  end
end
