Current section
7 Versions
Jump to
Current section
7 Versions
Compare versions
4
files changed
+8
additions
-3
deletions
| @@ -24,4 +24,4 @@ | |
| 24 24 | {<<"optional">>,false}, |
| 25 25 | {<<"repository">>,<<"hexpm">>}, |
| 26 26 | {<<"requirement">>,<<"~> 1.0">>}]]}. |
| 27 | - {<<"version">>,<<"0.0.2">>}. |
| 27 | + {<<"version">>,<<"0.0.3">>}. |
| @@ -47,7 +47,7 @@ defmodule HealthCheckex do | |
| 47 47 | quote do |
| 48 48 | def init(options), do: options |
| 49 49 | |
| 50 | - def call(conn = %Plug.Conn{path_info: [endpoint], method: "GET"}, _options) do |
| 50 | + def call(conn, _options) do |
| 51 51 | options = Application.get_all_env(:itk_health_checkex) |
| 52 52 | |
| 53 53 | options |> Keyword.get(:endpoint) |> do_call(conn, options) |
| @@ -2,7 +2,7 @@ defmodule ITKHealthCheckex.MixProject do | |
| 2 2 | use Mix.Project |
| 3 3 | |
| 4 4 | @project_url "https://github.com/inside-track/itk_health_checkex" |
| 5 | - @version "0.0.2" |
| 5 | + @version "0.0.3" |
| 6 6 | |
| 7 7 | def project do |
| 8 8 | [ |
| @@ -17,6 +17,11 @@ defmodule HealthCheckexTest do | |
| 17 17 | assert :get |> conn("/foo") |> HealthCheckerPlug.call(@opts) |> Map.get(:state) == :unset |
| 18 18 | end |
| 19 19 | |
| 20 | + test "it ignores all other methods" do |
| 21 | + [:post, :put, :delete] |
| 22 | + |> Enum.each(fn method -> assert method |> conn("/foo") |> HealthCheckerPlug.call(@opts) |> Map.get(:state) == :unset end) |
| 23 | + end |
| 24 | + |
| 20 25 | test "it responds to the defined endpoint", %{conn: conn} do |
| 21 26 | assert conn.status == 200 |
| 22 27 | assert conn.halted == true |