mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
17 lines
510 B
CoffeeScript
17 lines
510 B
CoffeeScript
describe "Discourse.KeyValueStore", ->
|
|
|
|
describe "Setting values", ->
|
|
|
|
store = Discourse.KeyValueStore
|
|
store.init("test")
|
|
|
|
it "able to get the value back from the store", ->
|
|
store.set(key: "bob", value: "uncle")
|
|
expect(store.get("bob")).toBe("uncle")
|
|
|
|
it "able to nuke the store", ->
|
|
store.set(key: "bob1", value: "uncle")
|
|
store.abandonLocal()
|
|
localStorage["a"] = 1
|
|
expect(store.get("bob1")).toBe(undefined)
|
|
expect(localStorage["a"]).toBe("1")
|