       employee: @valid_employee
     })
     assert json_response(conn, :created)
+
+    assert Repo.get_by(Company, @valid_company)
   end
 end

defmodule Appointments.RegistrationControllerTest do
  use Appointments.ConnCase

  @valid_company %{"name": "dawg inc"}
  @valid_employee %{

      employee: %{"first_name" => "Aron"}
    })
    assert json_response(conn, :unprocessable_entity)

    # Also test whether the company exists; that should not happen since
    # the transaction that created the company should've been rolled back
    refute Repo.get_by(Company, @valid_company)
  end

  test "should fail when email is already in use", %{conn: conn} do
