- Build rich, interactive web applications quickly, with less code and fewer moving parts. Join our growing community of developers using Phoenix to craft APIs, HTML5 apps and more, for fun or at scale.
-
diff --git a/lib/statusphere_elixir_web.ex b/lib/statusphere_web.ex
similarity index 85%
rename from lib/statusphere_elixir_web.ex
rename to lib/statusphere_web.ex
index 8992fb4..2905c5f 100644
--- a/lib/statusphere_elixir_web.ex
+++ b/lib/statusphere_web.ex
@@ -1,12 +1,12 @@
-defmodule StatusphereElixirWeb do
+defmodule StatusphereWeb do
@moduledoc """
The entrypoint for defining your web interface, such
as controllers, components, channels, and so on.
This can be used in your application as:
- use StatusphereElixirWeb, :controller
- use StatusphereElixirWeb, :html
+ use StatusphereWeb, :controller
+ use StatusphereWeb, :html
The definitions below will be executed for every controller,
component, etc, so keep them short and clean, focused
@@ -80,11 +80,11 @@ defmodule StatusphereElixirWeb do
# HTML escaping functionality
import Phoenix.HTML
# Core UI components
- import StatusphereElixirWeb.CoreComponents
+ import StatusphereWeb.CoreComponents
# Common modules used in templates
alias Phoenix.LiveView.JS
- alias StatusphereElixirWeb.Layouts
+ alias StatusphereWeb.Layouts
# Routes generation with the ~p sigil
unquote(verified_routes())
@@ -94,9 +94,9 @@ defmodule StatusphereElixirWeb do
def verified_routes do
quote do
use Phoenix.VerifiedRoutes,
- endpoint: StatusphereElixirWeb.Endpoint,
- router: StatusphereElixirWeb.Router,
- statics: StatusphereElixirWeb.static_paths()
+ endpoint: StatusphereWeb.Endpoint,
+ router: StatusphereWeb.Router,
+ statics: StatusphereWeb.static_paths()
end
end
diff --git a/lib/statusphere_elixir_web/components/core_components.ex b/lib/statusphere_web/components/core_components.ex
similarity index 98%
rename from lib/statusphere_elixir_web/components/core_components.ex
rename to lib/statusphere_web/components/core_components.ex
index 107ca63..d2cf804 100644
--- a/lib/statusphere_elixir_web/components/core_components.ex
+++ b/lib/statusphere_web/components/core_components.ex
@@ -1,4 +1,4 @@
-defmodule StatusphereElixirWeb.CoreComponents do
+defmodule StatusphereWeb.CoreComponents do
@moduledoc """
Provides core UI components.
@@ -475,9 +475,9 @@ defmodule StatusphereElixirWeb.CoreComponents do
# uncommenting and adjusting the following code:
# if count = opts[:count] do
- # Gettext.dngettext(StatusphereElixirWeb.Gettext, "errors", msg, msg, count, opts)
+ # Gettext.dngettext(StatusphereWeb.Gettext, "errors", msg, msg, count, opts)
# else
- # Gettext.dgettext(StatusphereElixirWeb.Gettext, "errors", msg, opts)
+ # Gettext.dgettext(StatusphereWeb.Gettext, "errors", msg, opts)
# end
Enum.reduce(opts, msg, fn {key, value}, acc ->
diff --git a/lib/statusphere_elixir_web/components/layouts.ex b/lib/statusphere_web/components/layouts.ex
similarity index 98%
rename from lib/statusphere_elixir_web/components/layouts.ex
rename to lib/statusphere_web/components/layouts.ex
index 1c6c585..1ea30d3 100644
--- a/lib/statusphere_elixir_web/components/layouts.ex
+++ b/lib/statusphere_web/components/layouts.ex
@@ -1,9 +1,9 @@
-defmodule StatusphereElixirWeb.Layouts do
+defmodule StatusphereWeb.Layouts do
@moduledoc """
This module holds layouts and related functionality
used by your application.
"""
- use StatusphereElixirWeb, :html
+ use StatusphereWeb, :html
# Embed all files in layouts/* within this module.
# The default root.html.heex file contains the HTML
diff --git a/lib/statusphere_elixir_web/components/layouts/root.html.heex b/lib/statusphere_web/components/layouts/root.html.heex
similarity index 94%
rename from lib/statusphere_elixir_web/components/layouts/root.html.heex
rename to lib/statusphere_web/components/layouts/root.html.heex
index c515aa7..489d356 100644
--- a/lib/statusphere_elixir_web/components/layouts/root.html.heex
+++ b/lib/statusphere_web/components/layouts/root.html.heex
@@ -4,7 +4,7 @@
- <.live_title default="StatusphereElixir" suffix=" · Phoenix Framework">
+ <.live_title default="Statusphere" suffix=" · Phoenix Framework">
{assigns[:page_title]}
diff --git a/lib/statusphere_elixir_web/controllers/error_html.ex b/lib/statusphere_web/controllers/error_html.ex
similarity index 71%
rename from lib/statusphere_elixir_web/controllers/error_html.ex
rename to lib/statusphere_web/controllers/error_html.ex
index cc7a396..944dea3 100644
--- a/lib/statusphere_elixir_web/controllers/error_html.ex
+++ b/lib/statusphere_web/controllers/error_html.ex
@@ -1,17 +1,17 @@
-defmodule StatusphereElixirWeb.ErrorHTML do
+defmodule StatusphereWeb.ErrorHTML do
@moduledoc """
This module is invoked by your endpoint in case of errors on HTML requests.
See config/config.exs.
"""
- use StatusphereElixirWeb, :html
+ use StatusphereWeb, :html
# If you want to customize your error pages,
# uncomment the embed_templates/1 call below
# and add pages to the error directory:
#
- # * lib/statusphere_elixir_web/controllers/error_html/404.html.heex
- # * lib/statusphere_elixir_web/controllers/error_html/500.html.heex
+ # * lib/statusphere_web/controllers/error_html/404.html.heex
+ # * lib/statusphere_web/controllers/error_html/500.html.heex
#
# embed_templates "error_html/*"
diff --git a/lib/statusphere_elixir_web/controllers/error_json.ex b/lib/statusphere_web/controllers/error_json.ex
similarity index 93%
rename from lib/statusphere_elixir_web/controllers/error_json.ex
rename to lib/statusphere_web/controllers/error_json.ex
index 7a0e672..07596a2 100644
--- a/lib/statusphere_elixir_web/controllers/error_json.ex
+++ b/lib/statusphere_web/controllers/error_json.ex
@@ -1,4 +1,4 @@
-defmodule StatusphereElixirWeb.ErrorJSON do
+defmodule StatusphereWeb.ErrorJSON do
@moduledoc """
This module is invoked by your endpoint in case of errors on JSON requests.
diff --git a/lib/statusphere_web/controllers/page_controller.ex b/lib/statusphere_web/controllers/page_controller.ex
new file mode 100644
index 0000000..ebd9aec
--- /dev/null
+++ b/lib/statusphere_web/controllers/page_controller.ex
@@ -0,0 +1,7 @@
+defmodule StatusphereWeb.PageController do
+ use StatusphereWeb, :controller
+
+ def home(conn, _params) do
+ render(conn, :home)
+ end
+end
diff --git a/lib/statusphere_elixir_web/controllers/page_html.ex b/lib/statusphere_web/controllers/page_html.ex
similarity index 69%
rename from lib/statusphere_elixir_web/controllers/page_html.ex
rename to lib/statusphere_web/controllers/page_html.ex
index b3fcaca..e339931 100644
--- a/lib/statusphere_elixir_web/controllers/page_html.ex
+++ b/lib/statusphere_web/controllers/page_html.ex
@@ -1,10 +1,10 @@
-defmodule StatusphereElixirWeb.PageHTML do
+defmodule StatusphereWeb.PageHTML do
@moduledoc """
This module contains pages rendered by PageController.
See the `page_html` directory for all templates available.
"""
- use StatusphereElixirWeb, :html
+ use StatusphereWeb, :html
embed_templates "page_html/*"
end
diff --git a/lib/statusphere_web/controllers/page_html/home.html.heex b/lib/statusphere_web/controllers/page_html/home.html.heex
new file mode 100644
index 0000000..97a48f5
--- /dev/null
+++ b/lib/statusphere_web/controllers/page_html/home.html.heex
@@ -0,0 +1,3 @@
+
+
hello
+
\ No newline at end of file
diff --git a/lib/statusphere_elixir_web/endpoint.ex b/lib/statusphere_web/endpoint.ex
similarity index 82%
rename from lib/statusphere_elixir_web/endpoint.ex
rename to lib/statusphere_web/endpoint.ex
index 2e016a6..ddb15f9 100644
--- a/lib/statusphere_elixir_web/endpoint.ex
+++ b/lib/statusphere_web/endpoint.ex
@@ -1,12 +1,12 @@
-defmodule StatusphereElixirWeb.Endpoint do
- use Phoenix.Endpoint, otp_app: :statusphere_elixir
+defmodule StatusphereWeb.Endpoint do
+ use Phoenix.Endpoint, otp_app: :statusphere
# The session will be stored in the cookie and signed,
# this means its contents can be read but not tampered with.
# Set :encryption_salt if you would also like to encrypt it.
@session_options [
store: :cookie,
- key: "_statusphere_elixir_key",
+ key: "_statusphere_key",
signing_salt: "zbKtWcZI",
same_site: "Lax"
]
@@ -22,9 +22,9 @@ defmodule StatusphereElixirWeb.Endpoint do
# static files generated by running `phx.digest`.
plug Plug.Static,
at: "/",
- from: :statusphere_elixir,
+ from: :statusphere,
gzip: not code_reloading?,
- only: StatusphereElixirWeb.static_paths(),
+ only: StatusphereWeb.static_paths(),
raise_on_missing_only: code_reloading?
# Code reloading can be explicitly enabled under the
@@ -33,7 +33,7 @@ defmodule StatusphereElixirWeb.Endpoint do
socket "/phoenix/live_reload/socket", Phoenix.LiveReloader.Socket
plug Phoenix.LiveReloader
plug Phoenix.CodeReloader
- plug Phoenix.Ecto.CheckRepoStatus, otp_app: :statusphere_elixir
+ plug Phoenix.Ecto.CheckRepoStatus, otp_app: :statusphere
end
plug Phoenix.LiveDashboard.RequestLogger,
@@ -51,5 +51,5 @@ defmodule StatusphereElixirWeb.Endpoint do
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options
- plug StatusphereElixirWeb.Router
+ plug StatusphereWeb.Router
end
diff --git a/lib/statusphere_elixir_web/router.ex b/lib/statusphere_web/router.ex
similarity index 64%
rename from lib/statusphere_elixir_web/router.ex
rename to lib/statusphere_web/router.ex
index 49eba59..5d910f2 100644
--- a/lib/statusphere_elixir_web/router.ex
+++ b/lib/statusphere_web/router.ex
@@ -1,11 +1,11 @@
-defmodule StatusphereElixirWeb.Router do
- use StatusphereElixirWeb, :router
+defmodule StatusphereWeb.Router do
+ use StatusphereWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_live_flash
- plug :put_root_layout, html: {StatusphereElixirWeb.Layouts, :root}
+ plug :put_root_layout, html: {StatusphereWeb.Layouts, :root}
plug :protect_from_forgery
plug :put_secure_browser_headers
end
@@ -14,19 +14,21 @@ defmodule StatusphereElixirWeb.Router do
plug :accepts, ["json"]
end
- scope "/", StatusphereElixirWeb do
+ scope "/", StatusphereWeb do
pipe_through :browser
get "/", PageController, :home
end
+ forward "/oauth", Atex.OAuth.Plug, callback: {__MODULE__, :oauth_callback, []}
+
# Other scopes may use custom stacks.
- # scope "/api", StatusphereElixirWeb do
+ # scope "/api", StatusphereWeb do
# pipe_through :api
# end
# Enable LiveDashboard in development
- if Application.compile_env(:statusphere_elixir, :dev_routes) do
+ if Application.compile_env(:statusphere, :dev_routes) do
# If you want to use the LiveDashboard in production, you should put
# it behind authentication and allow only admins to access it.
# If your application does not have an admins-only section yet,
@@ -37,7 +39,11 @@ defmodule StatusphereElixirWeb.Router do
scope "/dev" do
pipe_through :browser
- live_dashboard "/dashboard", metrics: StatusphereElixirWeb.Telemetry
+ live_dashboard "/dashboard", metrics: StatusphereWeb.Telemetry
end
end
+
+ def oauth_callback(conn) do
+ redirect(conn, to: "/")
+ end
end
diff --git a/lib/statusphere_elixir_web/telemetry.ex b/lib/statusphere_web/telemetry.ex
similarity index 87%
rename from lib/statusphere_elixir_web/telemetry.ex
rename to lib/statusphere_web/telemetry.ex
index 5a7d7bd..45a9e7f 100644
--- a/lib/statusphere_elixir_web/telemetry.ex
+++ b/lib/statusphere_web/telemetry.ex
@@ -1,4 +1,4 @@
-defmodule StatusphereElixirWeb.Telemetry do
+defmodule StatusphereWeb.Telemetry do
use Supervisor
import Telemetry.Metrics
@@ -53,23 +53,23 @@ defmodule StatusphereElixirWeb.Telemetry do
),
# Database Metrics
- summary("statusphere_elixir.repo.query.total_time",
+ summary("statusphere.repo.query.total_time",
unit: {:native, :millisecond},
description: "The sum of the other measurements"
),
- summary("statusphere_elixir.repo.query.decode_time",
+ summary("statusphere.repo.query.decode_time",
unit: {:native, :millisecond},
description: "The time spent decoding the data received from the database"
),
- summary("statusphere_elixir.repo.query.query_time",
+ summary("statusphere.repo.query.query_time",
unit: {:native, :millisecond},
description: "The time spent executing the query"
),
- summary("statusphere_elixir.repo.query.queue_time",
+ summary("statusphere.repo.query.queue_time",
unit: {:native, :millisecond},
description: "The time spent waiting for a database connection"
),
- summary("statusphere_elixir.repo.query.idle_time",
+ summary("statusphere.repo.query.idle_time",
unit: {:native, :millisecond},
description:
"The time the connection spent waiting before being checked out for the query"
@@ -87,7 +87,7 @@ defmodule StatusphereElixirWeb.Telemetry do
[
# A module, function and arguments to be invoked periodically.
# This function must call :telemetry.execute/3 and a metric must be added above.
- # {StatusphereElixirWeb, :count_users, []}
+ # {StatusphereWeb, :count_users, []}
]
end
end
diff --git a/mix.exs b/mix.exs
index 477240c..74d8a72 100644
--- a/mix.exs
+++ b/mix.exs
@@ -1,9 +1,9 @@
-defmodule StatusphereElixir.MixProject do
+defmodule Statusphere.MixProject do
use Mix.Project
def project do
[
- app: :statusphere_elixir,
+ app: :statusphere,
version: "0.1.0",
elixir: "~> 1.15",
elixirc_paths: elixirc_paths(Mix.env()),
@@ -20,7 +20,7 @@ defmodule StatusphereElixir.MixProject do
# Type `mix help compile.app` for more information.
def application do
[
- mod: {StatusphereElixir.Application, []},
+ mod: {Statusphere.Application, []},
extra_applications: [:logger, :runtime_tools]
]
end
@@ -63,7 +63,9 @@ defmodule StatusphereElixir.MixProject do
{:jason, "~> 1.2"},
{:dns_cluster, "~> 0.2.0"},
{:bandit, "~> 1.5"},
- {:atex, "~> 0.6"},
+ # {:atex, "~> 0.6"},
+ {:atex,
+ git: "https://github.com/cometsh/atex.git", ref: "2cc3686d47e30118ac8ac2d48cdc135a13da9163"},
{:drinkup, "~> 0.1"},
{:typedstruct, "~> 0.5"}
]
@@ -85,10 +87,10 @@ defmodule StatusphereElixir.MixProject do
# "tailwind.install --if-missing",
"esbuild.install --if-missing"
],
- "assets.build": ["compile", "tailwind statusphere_elixir", "esbuild statusphere_elixir"],
+ "assets.build": ["compile", "tailwind statusphere", "esbuild statusphere"],
"assets.deploy": [
- "tailwind statusphere_elixir --minify",
- "esbuild statusphere_elixir --minify",
+ "tailwind statusphere --minify",
+ "esbuild statusphere --minify",
"phx.digest"
],
precommit: ["compile --warnings-as-errors", "deps.unlock --unused", "format", "test"]
diff --git a/mix.lock b/mix.lock
index b66a9d3..8de1958 100644
--- a/mix.lock
+++ b/mix.lock
@@ -1,5 +1,5 @@
%{
- "atex": {:hex, :atex, "0.6.0", "a02f3c1b3ef04d8cd30243a05fc3629929c66d826e1d6a7e9d4ec6076ac89aea", [:mix], [{:ex_cldr, "~> 2.42", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:jose, "~> 1.11", [hex: :jose, repo: "hexpm", optional: false]}, {:multiformats_ex, "~> 0.2", [hex: :multiformats_ex, repo: "hexpm", optional: false]}, {:peri, "~> 0.6", [hex: :peri, repo: "hexpm", optional: false]}, {:plug, "~> 1.18", [hex: :plug, repo: "hexpm", optional: false]}, {:recase, "~> 0.5", [hex: :recase, repo: "hexpm", optional: false]}, {:req, "~> 0.5", [hex: :req, repo: "hexpm", optional: false]}, {:typedstruct, "~> 0.5", [hex: :typedstruct, repo: "hexpm", optional: false]}], "hexpm", "a3615e361e1e1b2887910834b3ede88680a02e4d585243ea90d0a6394f688aa2"},
+ "atex": {:git, "https://github.com/cometsh/atex.git", "2cc3686d47e30118ac8ac2d48cdc135a13da9163", [ref: "2cc3686d47e30118ac8ac2d48cdc135a13da9163"]},
"bandit": {:hex, :bandit, "1.9.0", "6dc1ff2c30948dfecf32db574cc3447c7b9d70e0b61140098df3818870b01b76", [:mix], [{:hpax, "~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.18", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "2538aaa1663b40ca9cbd8ca1f8a540cb49e5baf34c6ffef068369cc45f9146f2"},
"car": {:hex, :car, "0.1.1", "a5bc4c5c1be96eab437634b3c0ccad1fe17b5e3d68c22a4031241ae1345aebd4", [:mix], [{:cbor, "~> 1.0.0", [hex: :cbor, repo: "hexpm", optional: false]}, {:typedstruct, "~> 0.5", [hex: :typedstruct, repo: "hexpm", optional: false]}, {:varint, "~> 1.4", [hex: :varint, repo: "hexpm", optional: false]}], "hexpm", "f895dda8123d04dd336db5a2bf0d0b47f4559cd5383f83fcca0700c1b45bfb6a"},
"cbor": {:hex, :cbor, "1.0.1", "39511158e8ea5a57c1fcb9639aaa7efde67129678fee49ebbda780f6f24959b0", [:mix], [], "hexpm", "5431acbe7a7908f17f6a9cd43311002836a34a8ab01876918d8cfb709cd8b6a2"},
diff --git a/priv/repo/seeds.exs b/priv/repo/seeds.exs
index 8851c57..d727035 100644
--- a/priv/repo/seeds.exs
+++ b/priv/repo/seeds.exs
@@ -5,7 +5,7 @@
# Inside the script, you can read and write to any of your
# repositories directly:
#
-# StatusphereElixir.Repo.insert!(%StatusphereElixir.SomeSchema{})
+# Statusphere.Repo.insert!(%Statusphere.SomeSchema{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if something goes wrong.
diff --git a/test/statusphere_elixir_web/controllers/error_html_test.exs b/test/statusphere_elixir_web/controllers/error_html_test.exs
index 226b4c1..091077f 100644
--- a/test/statusphere_elixir_web/controllers/error_html_test.exs
+++ b/test/statusphere_elixir_web/controllers/error_html_test.exs
@@ -1,14 +1,15 @@
-defmodule StatusphereElixirWeb.ErrorHTMLTest do
- use StatusphereElixirWeb.ConnCase, async: true
+defmodule StatusphereWeb.ErrorHTMLTest do
+ use StatusphereWeb.ConnCase, async: true
# Bring render_to_string/4 for testing custom views
import Phoenix.Template, only: [render_to_string: 4]
test "renders 404.html" do
- assert render_to_string(StatusphereElixirWeb.ErrorHTML, "404", "html", []) == "Not Found"
+ assert render_to_string(StatusphereWeb.ErrorHTML, "404", "html", []) == "Not Found"
end
test "renders 500.html" do
- assert render_to_string(StatusphereElixirWeb.ErrorHTML, "500", "html", []) == "Internal Server Error"
+ assert render_to_string(StatusphereWeb.ErrorHTML, "500", "html", []) ==
+ "Internal Server Error"
end
end
diff --git a/test/statusphere_elixir_web/controllers/error_json_test.exs b/test/statusphere_elixir_web/controllers/error_json_test.exs
index 5b43b12..a0daaab 100644
--- a/test/statusphere_elixir_web/controllers/error_json_test.exs
+++ b/test/statusphere_elixir_web/controllers/error_json_test.exs
@@ -1,12 +1,12 @@
-defmodule StatusphereElixirWeb.ErrorJSONTest do
- use StatusphereElixirWeb.ConnCase, async: true
+defmodule StatusphereWeb.ErrorJSONTest do
+ use StatusphereWeb.ConnCase, async: true
test "renders 404" do
- assert StatusphereElixirWeb.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}}
+ assert StatusphereWeb.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}}
end
test "renders 500" do
- assert StatusphereElixirWeb.ErrorJSON.render("500.json", %{}) ==
+ assert StatusphereWeb.ErrorJSON.render("500.json", %{}) ==
%{errors: %{detail: "Internal Server Error"}}
end
end
diff --git a/test/statusphere_elixir_web/controllers/page_controller_test.exs b/test/statusphere_elixir_web/controllers/page_controller_test.exs
index c584c49..72852f7 100644
--- a/test/statusphere_elixir_web/controllers/page_controller_test.exs
+++ b/test/statusphere_elixir_web/controllers/page_controller_test.exs
@@ -1,5 +1,5 @@
-defmodule StatusphereElixirWeb.PageControllerTest do
- use StatusphereElixirWeb.ConnCase
+defmodule StatusphereWeb.PageControllerTest do
+ use StatusphereWeb.ConnCase
test "GET /", %{conn: conn} do
conn = get(conn, ~p"/")
diff --git a/test/support/conn_case.ex b/test/support/conn_case.ex
index 892742d..1671e9a 100644
--- a/test/support/conn_case.ex
+++ b/test/support/conn_case.ex
@@ -1,4 +1,4 @@
-defmodule StatusphereElixirWeb.ConnCase do
+defmodule StatusphereWeb.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 StatusphereElixirWeb.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 StatusphereElixirWeb.ConnCase, async: true`, although
+ by setting `use StatusphereWeb.ConnCase, async: true`, although
this option is not recommended for other databases.
"""
@@ -20,19 +20,19 @@ defmodule StatusphereElixirWeb.ConnCase do
using do
quote do
# The default endpoint for testing
- @endpoint StatusphereElixirWeb.Endpoint
+ @endpoint StatusphereWeb.Endpoint
- use StatusphereElixirWeb, :verified_routes
+ use StatusphereWeb, :verified_routes
# Import conveniences for testing with connections
import Plug.Conn
import Phoenix.ConnTest
- import StatusphereElixirWeb.ConnCase
+ import StatusphereWeb.ConnCase
end
end
setup tags do
- StatusphereElixir.DataCase.setup_sandbox(tags)
+ Statusphere.DataCase.setup_sandbox(tags)
{:ok, conn: Phoenix.ConnTest.build_conn()}
end
end
diff --git a/test/support/data_case.ex b/test/support/data_case.ex
index c4c26e1..29a5ec7 100644
--- a/test/support/data_case.ex
+++ b/test/support/data_case.ex
@@ -1,4 +1,4 @@
-defmodule StatusphereElixir.DataCase do
+defmodule Statusphere.DataCase do
@moduledoc """
This module defines the setup for tests requiring
access to the application's data layer.
@@ -10,7 +10,7 @@ defmodule StatusphereElixir.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 StatusphereElixir.DataCase, async: true`, although
+ by setting `use Statusphere.DataCase, async: true`, although
this option is not recommended for other databases.
"""
@@ -18,17 +18,17 @@ defmodule StatusphereElixir.DataCase do
using do
quote do
- alias StatusphereElixir.Repo
+ alias Statusphere.Repo
import Ecto
import Ecto.Changeset
import Ecto.Query
- import StatusphereElixir.DataCase
+ import Statusphere.DataCase
end
end
setup tags do
- StatusphereElixir.DataCase.setup_sandbox(tags)
+ Statusphere.DataCase.setup_sandbox(tags)
:ok
end
@@ -36,7 +36,7 @@ defmodule StatusphereElixir.DataCase do
Sets up the sandbox based on the test tags.
"""
def setup_sandbox(tags) do
- pid = Ecto.Adapters.SQL.Sandbox.start_owner!(StatusphereElixir.Repo, shared: not tags[:async])
+ pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Statusphere.Repo, shared: not tags[:async])
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
end
diff --git a/test/test_helper.exs b/test/test_helper.exs
index 8c28574..9174297 100644
--- a/test/test_helper.exs
+++ b/test/test_helper.exs
@@ -1,2 +1,2 @@
ExUnit.start()
-Ecto.Adapters.SQL.Sandbox.mode(StatusphereElixir.Repo, :manual)
+Ecto.Adapters.SQL.Sandbox.mode(Statusphere.Repo, :manual)