rename to memex

This commit is contained in:
2023-02-26 00:47:51 -05:00
parent 9b4837a044
commit bc2c936480
126 changed files with 791 additions and 791 deletions

View File

@ -1,4 +1,4 @@
defmodule LokalWeb.ChannelCase do
defmodule MemexWeb.ChannelCase do
@moduledoc """
This module defines the test case to be used by
channel tests.
@ -11,7 +11,7 @@ defmodule LokalWeb.ChannelCase 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 LokalWeb.ChannelCase, async: true`, although
by setting `use MemexWeb.ChannelCase, async: true`, although
this option is not recommended for other databases.
"""
@ -22,15 +22,15 @@ defmodule LokalWeb.ChannelCase do
quote do
# Import conveniences for testing with channels
import Phoenix.ChannelTest
import LokalWeb.ChannelCase
import MemexWeb.ChannelCase
# The default endpoint for testing
@endpoint LokalWeb.Endpoint
@endpoint MemexWeb.Endpoint
end
end
setup tags do
pid = Sandbox.start_owner!(Lokal.Repo, shared: not tags[:async])
pid = Sandbox.start_owner!(Memex.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
:ok
end

View File

@ -1,4 +1,4 @@
defmodule LokalWeb.ConnCase do
defmodule MemexWeb.ConnCase do
@moduledoc """
This module defines the test case to be used by
tests that require setting up a connection.
@ -11,14 +11,14 @@ defmodule LokalWeb.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 LokalWeb.ConnCase, async: true`, although
by setting `use MemexWeb.ConnCase, async: true`, although
this option is not recommended for other databases.
"""
use ExUnit.CaseTemplate
import Lokal.Fixtures
import Memex.Fixtures
alias Ecto.Adapters.SQL.Sandbox
alias Lokal.{Accounts, Accounts.User, Repo}
alias Memex.{Accounts, Accounts.User, Repo}
using do
quote do
@ -26,18 +26,18 @@ defmodule LokalWeb.ConnCase do
import Plug.Conn
import Phoenix.ConnTest
# credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse
import Lokal.Fixtures
import LokalWeb.ConnCase
import Memex.Fixtures
import MemexWeb.ConnCase
alias LokalWeb.Router.Helpers, as: Routes
alias MemexWeb.Router.Helpers, as: Routes
# The default endpoint for testing
@endpoint LokalWeb.Endpoint
@endpoint MemexWeb.Endpoint
end
end
setup tags do
pid = Sandbox.start_owner!(Lokal.Repo, shared: not tags[:async])
pid = Sandbox.start_owner!(Memex.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
{:ok, conn: Phoenix.ConnTest.build_conn()}
end
@ -69,7 +69,7 @@ defmodule LokalWeb.ConnCase do
It returns an updated `conn`.
"""
def log_in_user(conn, user) do
token = Lokal.Accounts.generate_user_session_token(user)
token = Memex.Accounts.generate_user_session_token(user)
conn
|> Phoenix.ConnTest.init_test_session(%{})

View File

@ -1,4 +1,4 @@
defmodule Lokal.DataCase do
defmodule Memex.DataCase do
@moduledoc """
This module defines the setup for tests requiring
access to the application's data layer.
@ -10,7 +10,7 @@ defmodule Lokal.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 Lokal.DataCase, async: true`, although
by setting `use Memex.DataCase, async: true`, although
this option is not recommended for other databases.
"""
@ -19,16 +19,16 @@ defmodule Lokal.DataCase do
using do
quote do
alias Lokal.Repo
alias Memex.Repo
import Ecto
import Ecto.{Changeset, Query}
import Lokal.{DataCase, Fixtures}
import Memex.{DataCase, Fixtures}
end
end
setup tags do
pid = Sandbox.start_owner!(Lokal.Repo, shared: not tags[:async])
pid = Sandbox.start_owner!(Memex.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
:ok
end

View File

@ -1,9 +1,9 @@
defmodule Lokal.Fixtures do
defmodule Memex.Fixtures do
@moduledoc """
This module defines test helpers for creating entities
"""
alias Lokal.{Accounts, Accounts.User, Email, Repo}
alias Memex.{Accounts, Accounts.User, Email, Repo}
def unique_user_email, do: "user#{System.unique_integer()}@example.com"
def valid_user_password, do: "hello world!"