send_jsoncome from (referenced here: https://luckyframework.org/guides/testing/testing-actions#json-actions)?
undefined method 'send_json' for top-level
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
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
putsstatements 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.
createdbis running and is looking for
template0even 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?
peeras I was previously
linkin 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::LinkHelpersrather 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