test: fix Closed stream (IO::Error)

This commit is contained in:
Juan Rodriguez
2024-05-14 06:34:29 +02:00
parent aa8a84af0e
commit be0ebd1763
3 changed files with 5 additions and 4 deletions
-2
View File
@@ -3,5 +3,3 @@ require "kemal"
Kemal.config.env = ENV["ENV"]? || "development"
Kemal.config.port = ENV["PORT"]?.try(&.to_i) || 4000
Kemal.config.host_binding = ENV["HOST"]? || "0.0.0.0"
Kemal.config.logging = true
+3 -2
View File
@@ -78,10 +78,11 @@ describe App::Controllers::Link do
serialized_link = App::Serializers::Link.new(test_link)
get(serialized_link.refer, headers: HTTP::Headers{"X-Api-Key" => test_user.api_key.to_s})
updated_test_link = get_test_link(test_link.id)
Fiber.yield
response.headers["Location"].should eq(link)
updated_test_link = get_test_link(test_link.id)
updated_test_link.click_counter.should eq(1)
end
+2
View File
@@ -8,6 +8,8 @@ require "../url-shortener"
Spec.before_suite do
Micrate::DB.connection_url = ENV["DATABASE_URL"]
Micrate::Cli.run_up
Kemal.config.logging = false
end
def create_test_user