I've got this spec:
it "returns a 503 (Service Unavailable) when HTML conversions are disabled" do
ENV["DISABLE_HTML_CONVERSION_API"] = "Shut it down!"
response = AppClient.exec(Api::HtmlConversions::Create.with(input: "<div>Test</div>"))
puts response
response.status_code.should eq(503)
end
And this before
action, where it complains that the ENV key is missing:
private def halt_if_html_conversion_disabled
puts ENV["DISABLE_HTML_CONVERSION_API"]
if ENV["DISABLE_HTML_CONVERSION_API"]?
head :service_unavailable
else
continue
end
end
puts
statements are just temporary :smile:)
@jwoertink After some investigating, it seems Avram connects on host
rather than local
for Posgres. So the solution to get password-less DB connections working was to add this to my pg_hba.conf
local all mwlang peer
host all mwlang 127.0.0.1/32 peer
which was kind of unexpected that both are needed because I would expect localhost
as the hostname to resolve to the local
entry always.
createdb
is running and is looking for template0
even though the test database already exists. Unhandled exception: It looks like Postgres is not running.
Message from Postgres:
createdb: error: could not connect to database template1: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
trust
instead of peer
as I was previously
link
in Lucky? I've been trying with something like what's below, but it's trying to match the union type to a signature in Lucky::LinkHelpers
rather than each individual type and throwing a compile error :(class UI::CardActionHeader < BaseComponent
needs title : String
needs link_text : String
needs link_target : Lucky::Action.class | Lucky::RouteHelper | String
def render
div class: "-ml-4 -mt-2 flex items-center justify-between flex-wrap sm:flex-no-wrap" do
div class: "ml-4 mt-2" do
h3 class: "text-lg leading-6 font-medium text-gray-900" do
text title
end
end
div class: "ml-4 mt-2 flex-shrink-0" do
span class: "inline-flex rounded-md shadow-sm" do
link link_text, to: link_target, class: "a lot of classes"
end
end
end
end
end
web | 15 | link link_text, to: link_target, class: "a lot of classes"
web | ^---
web | Error: no overload matches 'UI::CardActionHeader#link' with types String, to: (Lucky::Action.class | Lucky::RouteHelper | String), class: String
web |
web | Overloads are:
web | - Lucky::LinkHelpers#link(text, to : Lucky::RouteHelper, attrs : Array(Symbol) = [] of Symbol, **html_options)
web | - Lucky::LinkHelpers#link(text, to : Lucky::Action.class, attrs : Array(Symbol) = [] of Symbol, **html_options)
web | - Lucky::LinkHelpers#link(to : Lucky::RouteHelper, attrs : Array(Symbol) = [] of Symbol, **html_options, &block)
web | - Lucky::LinkHelpers#link(to : Lucky::Action.class, attrs : Array(Symbol) = [] of Symbol, **html_options, &block)
web | - Lucky::LinkHelpers#link(to : Lucky::RouteHelper, attrs : Array(Symbol) = [] of Symbol, **html_options)
web | - Lucky::LinkHelpers#link(to : Lucky::Action.class, attrs : Array(Symbol) = [] of Symbol, **html_options)
web | - Lucky::LinkHelpers#link(text, to : String, attrs : Array(Symbol) = [] of Symbol, **html_options)
web | - Lucky::LinkHelpers#link(to : String, attrs : Array(Symbol) = [] of Symbol, **html_options, &block)
Shared::Field
. This allows you to pass any option you want and use other methods like a
or button
instead of link
. But I haven't test yet so not sure. Might be worth exploring. Looking forward to seeing what you came up with @stephendolan!
with_defaults
and that seems to work pretty well!
Button
component to share common classes