Skip to content

Commit

Permalink
Upgrade to Phoenix 1.5
Browse files Browse the repository at this point in the history
Tests green and server works.

- fsevents misbehaving
- Live reload too
  • Loading branch information
msp committed Feb 22, 2022
1 parent 84a760b commit d878114
Show file tree
Hide file tree
Showing 11 changed files with 13,990 additions and 1,007 deletions.
2 changes: 1 addition & 1 deletion assets/css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ body {
.alert:empty { display: none; }

header {
@include divider
@include divider;

.row {
.logo, .category {
Expand Down
14,862 changes: 13,918 additions & 944 deletions assets/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"copy-webpack-plugin": "^4.5.0",
"css-loader": "^0.28.10",
"mini-css-extract-plugin": "^0.4.0",
"node-sass": "4.11.0",
"optimize-css-assets-webpack-plugin": "^4.0.0",
"sass": "^1.49.8",
"sass-loader": "7.2.0",
"twitter-text": "1.14.3",
"uglifyjs-webpack-plugin": "^1.2.4",
Expand Down
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ config :cenatus_ltd, CenatusLtdWeb.Endpoint,
url: [host: "localhost"],
secret_key_base: "jiBBNx/vDs11KHYmGbS6RGTAaINvSZBRyRGQTHwJWYCrJks+4AtTOCt+vkz5xAfR",
render_errors: [view: CenatusLtdWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: CenatusLtdWeb.PubSub, adapter: Phoenix.PubSub.PG2]
pubsub_server: [name: CenatusLtd.PubSub]

# Configures Elixir's Logger
config :logger, :console,
Expand Down
2 changes: 2 additions & 0 deletions lib/cenatus_ltd.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ defmodule CenatusLtd do

# Define workers and child supervisors to be supervised
children = [
# Start the PubSub system
{Phoenix.PubSub, name: CenatusLtd.PubSub},
# Start the Ecto repository
supervisor(CenatusLtd.Repo, []),
# Start the endpoint when the application starts
Expand Down
2 changes: 1 addition & 1 deletion lib/cenatus_ltd_web/templates/layout/app.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
%p.alert.alert-danger(role="alert")= get_flash(@conn, :error)

%main(role="main")
= render @view_module, @view_template, assigns
= @inner_content

%footer
.row.justify-content-between
Expand Down
14 changes: 7 additions & 7 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ defmodule CenatusLtd.Mixfile do
{:ecto_sql, "~> 3.0"},
{:elixirfm, "~> 0.0.10"},
{:ex_aws, "~> 1.0"},
{:extwitter, "~> 0.8"},
{:extwitter, "~> 0.12"},
{:floki, "~> 0.21.0"},
{:gettext, "~> 0.11"},
{:hackney, "~> 1.6", override: true},
{:html_sanitize_ex, "~> 1.2"},
{:jason, "~> 1.0"},
{:mix_test_watch, "~> 0.3", only: :dev, runtime: false},
{:phoenix, "~> 1.4.0"},
{:mix_test_watch, "~> 1.0", only: [:dev, :test], runtime: false},
{:phoenix, "~> 1.5.0"},
{:phoenix_ecto, "~> 4.0"},
{:phoenix_haml, "~> 0.2.1"},
{:phoenix_html, "~> 2.10.3"},
{:phoenix_html, "~> 2.10"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_pubsub, "~> 2.0"},
{:plug, "~> 1.7"},
{:plug_cowboy, "~> 2.0"},
{:plug_cowboy, "~> 2.1"},
{:poison, "~> 2.0", override: true},
{:postgrex, ">= 0.0.0"},
{:sitemap, "~> 0.9"},
{:timex, "~> 3.0"},
{:timex, "~> 3.0"}
]
end

Expand Down
100 changes: 51 additions & 49 deletions mix.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion test/controllers/article_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ defmodule CenatusLtdWeb.ArticleControllerTest do

describe "public routes" do
test "shows chosen resource", %{conn: conn} do
section = Repo.get_by(Section, name: "Blog")
section =
Category.changeset(%Section{}, %{name: "Blog"})
|> Repo.insert!()

category =
Category.changeset(%Category{name: "web dev"})
Expand Down
4 changes: 3 additions & 1 deletion test/controllers/blog_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ defmodule CenatusLtdWeb.BlogControllerTest do
end

defp create_data(_context) do
section = Repo.get_by(Section, name: "Blog")
section =
Category.changeset(%Section{}, %{name: "Blog"})
|> Repo.insert!()

category =
Category.changeset(%Category{name: "XR research"})
Expand Down
3 changes: 2 additions & 1 deletion test/support/conn_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ defmodule CenatusLtdWeb.ConnCase do
using do
quote do
# Import conveniences for testing with connections
use Phoenix.ConnTest
import Plug.Conn
import Phoenix.ConnTest

alias CenatusLtd.Repo
import Ecto
Expand Down

0 comments on commit d878114

Please sign in to comment.