+
+ describe "with a correct authorization header for an deactiviated user" do
+ test "it halts the appication", %{conn: conn} do
+ opts = %{
+ optional: false,
+ fetcher: fn _ -> @deactivated end
+ }
+
+ header = basic_auth_enc("dude", "guy")
+
+ conn = conn
+ |> Plug.Session.call(Plug.Session.init(@session_opts))
+ |> fetch_session
+ |> put_req_header("authorization", header)
+ |> AuthenticationPlug.call(opts)
+
+ assert conn.status == 403
+ assert conn.halted == true
+ end
+ end
+