Skip to content

Instantly share code, notes, and snippets.

@chrismccord
Last active August 29, 2015 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrismccord/4a62780056b08c60542d to your computer and use it in GitHub Desktop.
Save chrismccord/4a62780056b08c60542d to your computer and use it in GitHub Desktop.
Phoenix Upgrade Instructions 0.13.0 to 0.13.1

JavaScript Client

Update your web/static/vendor/phoenix.js to the latest client: https://github.com/phoenixframework/phoenix/blob/v0.13.1/priv/static/phoenix.js

Channel Tests

Simply create a test/support/channel_case.ex file and replace the following MyApp with your application:

defmodule MyApp.ChannelCase do
  @moduledoc """
  This module defines the test case to be used by
  channel tests.

  Such tests rely on `Phoenix.ChannelTest` and also
  imports other functionality to make it easier
  to build and query models.

  Finally, if the test case interacts with the database,
  it cannot be async. For this reason, every test runs
  inside a transaction which is reset at the beginning
  of the test unless the test case is marked as async.
  """

  use ExUnit.CaseTemplate

  using do
    quote do
      # Import conveniences for testing with channels
      use Phoenix.ChannelTest

      # Alias the data repository and import query/model functions
      alias MyApp.Repo
      import Ecto.Model
      import Ecto.Query, only: [from: 2]


      # The default endpoint for testing
      @endpoint MyApp.Endpoint
    end
  end

  setup tags do
    # only if using Ecto, remove otherwise
    unless tags[:async] do
      Ecto.Adapters.SQL.restart_test_transaction(MyApp.Repo, [])
    end

    :ok
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment