Skip to content

Commit 4e4599f

Browse files
committed
Fix spec for parsing invalid JSON
The cookie adapter uses string as a key, so should the spec. Also, context.request.cookies is a hash in both cases, it feels that it should be set directly, not using a hash with "value" and "expires" keys.
1 parent 95795b4 commit 4e4599f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

spec/persistence/cookie_adapter_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
end
1515

1616
it "handles invalid JSON" do
17-
context.request.cookies[:split] = {
18-
value: '{"foo":2,',
19-
expires: Time.now
20-
}
17+
context.request.cookies["split"] = "{\"foo\":2,"
18+
2119
expect(subject["my_key"]).to be_nil
2220
subject["my_key"] = "my_value"
2321
expect(subject["my_key"]).to eq("my_value")

0 commit comments

Comments
 (0)