Fix sessions middleware spec (#1247)

This array structure will work with the new way of loading middleware.
This commit is contained in:
Tim Riley 2022-11-08 22:45:24 +11:00 committed by GitHub
parent 1ae2249953
commit 92285080aa
2 changed files with 2 additions and 4 deletions

View File

@ -62,7 +62,7 @@ module Hanami
def middleware
return [] unless enabled?
[[storage_middleware, options]]
[storage_middleware, options].flatten
end
private

View File

@ -42,9 +42,7 @@ RSpec.describe Hanami::Config::Actions, "#sessions" do
end
it "returns an array of middleware classes and options" do
expect(sessions.middleware).to eq [
[Rack::Session::Cookie, [secret: "abc"]]
]
expect(sessions.middleware).to eq [Rack::Session::Cookie, {secret: "abc"}]
end
end
end