class PoliciesControllerTest < ActionDispatch::IntegrationTest
  class CreateTest < self
    test "should return success" do
      params = {
        "policy_holder": "Bob Stevens",
        "premium_amount": 424.23,
        "industry_id": Industry.first.id,
        "carrier_id": Carrier.first.id,
        "agent_id": Agent.first.id
      }
      post policy_url, params: params.to_json
      assert_response :success
    end

    test "should return unprocessable entity if invalid params" do
      params = { "invalid": "params" }
      post policy_url, params: params.to_json
      assert_response :unprocessable_entity
    end
  end
end
