Rename repository
This commit is contained in:
parent
4aeb2d2cd8
commit
232df26b85
71 changed files with 348 additions and 345 deletions
|
@ -1,4 +1,4 @@
|
|||
defmodule MatrixServerWeb.ConnCase do
|
||||
defmodule ArchitexWeb.ConnCase do
|
||||
@moduledoc """
|
||||
This module defines the test case to be used by
|
||||
tests that require setting up a connection.
|
||||
|
@ -11,7 +11,7 @@ defmodule MatrixServerWeb.ConnCase do
|
|||
we enable the SQL sandbox, so changes done to the database
|
||||
are reverted at the end of every test. If you are using
|
||||
PostgreSQL, you can even run database tests asynchronously
|
||||
by setting `use MatrixServerWeb.ConnCase, async: true`, although
|
||||
by setting `use ArchitexWeb.ConnCase, async: true`, although
|
||||
this option is not recommended for other databases.
|
||||
"""
|
||||
|
||||
|
@ -22,20 +22,20 @@ defmodule MatrixServerWeb.ConnCase do
|
|||
# Import conveniences for testing with connections
|
||||
import Plug.Conn
|
||||
import Phoenix.ConnTest
|
||||
import MatrixServerWeb.ConnCase
|
||||
import ArchitexWeb.ConnCase
|
||||
|
||||
alias MatrixServerWeb.Router.Helpers, as: Routes
|
||||
alias ArchitexWeb.Router.Helpers, as: Routes
|
||||
|
||||
# The default endpoint for testing
|
||||
@endpoint MatrixServerWeb.Endpoint
|
||||
@endpoint ArchitexWeb.Endpoint
|
||||
end
|
||||
end
|
||||
|
||||
setup tags do
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(MatrixServer.Repo)
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Architex.Repo)
|
||||
|
||||
unless tags[:async] do
|
||||
Ecto.Adapters.SQL.Sandbox.mode(MatrixServer.Repo, {:shared, self()})
|
||||
Ecto.Adapters.SQL.Sandbox.mode(Architex.Repo, {:shared, self()})
|
||||
end
|
||||
|
||||
{:ok, conn: Phoenix.ConnTest.build_conn()}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
defmodule MatrixServer.DataCase do
|
||||
defmodule Architex.DataCase do
|
||||
@moduledoc """
|
||||
This module defines the setup for tests requiring
|
||||
access to the application's data layer.
|
||||
|
@ -10,7 +10,7 @@ defmodule MatrixServer.DataCase do
|
|||
we enable the SQL sandbox, so changes done to the database
|
||||
are reverted at the end of every test. If you are using
|
||||
PostgreSQL, you can even run database tests asynchronously
|
||||
by setting `use MatrixServer.DataCase, async: true`, although
|
||||
by setting `use Architex.DataCase, async: true`, although
|
||||
this option is not recommended for other databases.
|
||||
"""
|
||||
|
||||
|
@ -18,20 +18,20 @@ defmodule MatrixServer.DataCase do
|
|||
|
||||
using do
|
||||
quote do
|
||||
alias MatrixServer.Repo
|
||||
alias Architex.Repo
|
||||
|
||||
import Ecto
|
||||
import Ecto.Changeset
|
||||
import Ecto.Query
|
||||
import MatrixServer.DataCase
|
||||
import Architex.DataCase
|
||||
end
|
||||
end
|
||||
|
||||
setup tags do
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(MatrixServer.Repo)
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Architex.Repo)
|
||||
|
||||
unless tags[:async] do
|
||||
Ecto.Adapters.SQL.Sandbox.mode(MatrixServer.Repo, {:shared, self()})
|
||||
Ecto.Adapters.SQL.Sandbox.mode(Architex.Repo, {:shared, self()})
|
||||
end
|
||||
|
||||
:ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
defmodule MatrixServer.Factory do
|
||||
use ExMachina.Ecto, repo: MatrixServer.Repo
|
||||
defmodule Architex.Factory do
|
||||
use ExMachina.Ecto, repo: Architex.Repo
|
||||
|
||||
alias MatrixServer.{Account, Device}
|
||||
alias Architex.{Account, Device}
|
||||
|
||||
def account_factory do
|
||||
%Account{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue