refactored for new project name
This commit is contained in:
parent
0039146cd4
commit
82ab1d1ea5
113 changed files with 417 additions and 412 deletions
test/support
|
@ -1,4 +1,4 @@
|
|||
defmodule Bones73kWeb.ChannelCase do
|
||||
defmodule Shift73kWeb.ChannelCase do
|
||||
@moduledoc """
|
||||
This module defines the test case to be used by
|
||||
channel tests.
|
||||
|
@ -11,7 +11,7 @@ defmodule Bones73kWeb.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 Bones73kWeb.ChannelCase, async: true`, although
|
||||
by setting `use Shift73kWeb.ChannelCase, async: true`, although
|
||||
this option is not recommended for other databases.
|
||||
"""
|
||||
|
||||
|
@ -21,18 +21,18 @@ defmodule Bones73kWeb.ChannelCase do
|
|||
quote do
|
||||
# Import conveniences for testing with channels
|
||||
import Phoenix.ChannelTest
|
||||
import Bones73kWeb.ChannelCase
|
||||
import Shift73kWeb.ChannelCase
|
||||
|
||||
# The default endpoint for testing
|
||||
@endpoint Bones73kWeb.Endpoint
|
||||
@endpoint Shift73kWeb.Endpoint
|
||||
end
|
||||
end
|
||||
|
||||
setup tags do
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Bones73k.Repo)
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Shift73k.Repo)
|
||||
|
||||
unless tags[:async] do
|
||||
Ecto.Adapters.SQL.Sandbox.mode(Bones73k.Repo, {:shared, self()})
|
||||
Ecto.Adapters.SQL.Sandbox.mode(Shift73k.Repo, {:shared, self()})
|
||||
end
|
||||
|
||||
:ok
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
defmodule Bones73kWeb.ConnCase do
|
||||
defmodule Shift73kWeb.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 Bones73kWeb.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 Bones73kWeb.ConnCase, async: true`, although
|
||||
by setting `use Shift73kWeb.ConnCase, async: true`, although
|
||||
this option is not recommended for other databases.
|
||||
"""
|
||||
|
||||
|
@ -22,20 +22,20 @@ defmodule Bones73kWeb.ConnCase do
|
|||
# Import conveniences for testing with connections
|
||||
import Plug.Conn
|
||||
import Phoenix.ConnTest
|
||||
import Bones73kWeb.ConnCase
|
||||
import Shift73kWeb.ConnCase
|
||||
|
||||
alias Bones73kWeb.Router.Helpers, as: Routes
|
||||
alias Shift73kWeb.Router.Helpers, as: Routes
|
||||
|
||||
# The default endpoint for testing
|
||||
@endpoint Bones73kWeb.Endpoint
|
||||
@endpoint Shift73kWeb.Endpoint
|
||||
end
|
||||
end
|
||||
|
||||
setup tags do
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Bones73k.Repo)
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Shift73k.Repo)
|
||||
|
||||
unless tags[:async] do
|
||||
Ecto.Adapters.SQL.Sandbox.mode(Bones73k.Repo, {:shared, self()})
|
||||
Ecto.Adapters.SQL.Sandbox.mode(Shift73k.Repo, {:shared, self()})
|
||||
end
|
||||
|
||||
{:ok, conn: Phoenix.ConnTest.build_conn()}
|
||||
|
@ -50,7 +50,7 @@ defmodule Bones73kWeb.ConnCase do
|
|||
test context.
|
||||
"""
|
||||
def register_and_log_in_user(%{conn: conn}) do
|
||||
user = Bones73k.AccountsFixtures.user_fixture()
|
||||
user = Shift73k.AccountsFixtures.user_fixture()
|
||||
%{conn: log_in_user(conn, user), user: user}
|
||||
end
|
||||
|
||||
|
@ -60,7 +60,7 @@ defmodule Bones73kWeb.ConnCase do
|
|||
It returns an updated `conn`.
|
||||
"""
|
||||
def log_in_user(conn, user) do
|
||||
token = Bones73k.Accounts.generate_user_session_token(user)
|
||||
token = Shift73k.Accounts.generate_user_session_token(user)
|
||||
|
||||
conn
|
||||
|> Phoenix.ConnTest.init_test_session(%{})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
defmodule Bones73k.DataCase do
|
||||
defmodule Shift73k.DataCase do
|
||||
@moduledoc """
|
||||
This module defines the setup for tests requiring
|
||||
access to the application's data layer.
|
||||
|
@ -10,7 +10,7 @@ defmodule Bones73k.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 Bones73k.DataCase, async: true`, although
|
||||
by setting `use Shift73k.DataCase, async: true`, although
|
||||
this option is not recommended for other databases.
|
||||
"""
|
||||
|
||||
|
@ -18,20 +18,20 @@ defmodule Bones73k.DataCase do
|
|||
|
||||
using do
|
||||
quote do
|
||||
alias Bones73k.Repo
|
||||
alias Shift73k.Repo
|
||||
|
||||
import Ecto
|
||||
import Ecto.Changeset
|
||||
import Ecto.Query
|
||||
import Bones73k.DataCase
|
||||
import Shift73k.DataCase
|
||||
end
|
||||
end
|
||||
|
||||
setup tags do
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Bones73k.Repo)
|
||||
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Shift73k.Repo)
|
||||
|
||||
unless tags[:async] do
|
||||
Ecto.Adapters.SQL.Sandbox.mode(Bones73k.Repo, {:shared, self()})
|
||||
Ecto.Adapters.SQL.Sandbox.mode(Shift73k.Repo, {:shared, self()})
|
||||
end
|
||||
|
||||
:ok
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
defmodule Bones73k.AccountsFixtures do
|
||||
defmodule Shift73k.AccountsFixtures do
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Bones73k.Accounts` context.
|
||||
entities via the `Shift73k.Accounts` context.
|
||||
"""
|
||||
|
||||
def unique_user_email, do: "user#{System.unique_integer()}@example.com"
|
||||
|
@ -14,7 +14,7 @@ defmodule Bones73k.AccountsFixtures do
|
|||
email: unique_user_email(),
|
||||
password: valid_user_password()
|
||||
})
|
||||
|> Bones73k.Accounts.register_user()
|
||||
|> Shift73k.Accounts.register_user()
|
||||
|
||||
user
|
||||
end
|
||||
|
@ -27,7 +27,7 @@ defmodule Bones73k.AccountsFixtures do
|
|||
email: unique_user_email(),
|
||||
password: valid_user_password()
|
||||
})
|
||||
|> Bones73k.Accounts.register_user()
|
||||
|> Shift73k.Accounts.register_user()
|
||||
|
||||
user
|
||||
end
|
||||
|
@ -42,7 +42,7 @@ defmodule Bones73k.AccountsFixtures do
|
|||
end
|
||||
|
||||
def login_params_token(user, return_path) do
|
||||
Phoenix.Token.encrypt(Bones73kWeb.Endpoint, "login_params", %{
|
||||
Phoenix.Token.encrypt(Shift73kWeb.Endpoint, "login_params", %{
|
||||
user_id: user.id,
|
||||
user_return_to: return_path,
|
||||
messages: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue