Dreams

ns
dreamful-service.fixtures
(usens:)
server stuff
{:port 3001}start-serverport?
200pingport:port => 3001status?
(function:)

Create some profiles

Also, make sure we can't register the same profile twice

clientid?
1{:profile-id1 c6b02b75-d956-4f89-824a-4629e4dd8149}
2{:profile-id2 1a2fd87e-92a3-48d4-989e-b6f0620832a2}
3{:profile-id3 66153075-fd27-4bda-9c23-449902fe4b63}
(dt:register)

Create a dream!

clientid?
1{:dream-id1 15baf7a6-9462-4aa9-af15-87b176630fa3}
2{:dream-id2 d529be9d-20d8-4f7e-b975-bf33bdcb60e0}
(dt:new-dream)
dream-stuff
{:msg-id1 850f13b3-3292-4baf-9de4-b54f9507d2bd}add-messagemsgHello everybody!from1client1dream-id:dream-id1 => 15baf7a6-9462-4aa9-af15-87b176630fa3msg-id?
{:msg-id2 eaea0a85-f283-4e1e-99dd-e6a626f337e2}add-messagemsgHello everybody!from2client2dream-id:dream-id2 => d529be9d-20d8-4f7e-b975-bf33bdcb60e0msg-id?
(function: )

Can't clobber someone else's dream ID

(not yet implemented)

Get a dream message from my dream, but not from someone else's

idmsg-idxsubstrcontains?msg?
:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa30:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa3true{:msg {:msg "Hello everybody!"}, :dream_id "15baf7a6-9462-4aa9-af15-87b176630fa3", :msg_id #uuid "850f13b3-3292-4baf-9de4-b54f9507d2bd", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "c6b02b75-d956-4f89-824a-4629e4dd8149"}
:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa30:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e0false{:msg {:msg "Hello everybody!"}, :dream_id "15baf7a6-9462-4aa9-af15-87b176630fa3", :msg_id #uuid "850f13b3-3292-4baf-9de4-b54f9507d2bd", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "c6b02b75-d956-4f89-824a-4629e4dd8149"}
:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa30dream_idtrue{:msg {:msg "Hello everybody!"}, :dream_id "15baf7a6-9462-4aa9-af15-87b176630fa3", :msg_id #uuid "850f13b3-3292-4baf-9de4-b54f9507d2bd", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "c6b02b75-d956-4f89-824a-4629e4dd8149"}
:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e00:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e0false"dream not found"
:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e00dream not foundtrue"dream not found"
(dt:get-dream client=1)
idmsg-idxsubstrcontains?msg?
:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e00:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e0true{:msg {:msg "Hello everybody!"}, :dream_id "d529be9d-20d8-4f7e-b975-bf33bdcb60e0", :msg_id #uuid "eaea0a85-f283-4e1e-99dd-e6a626f337e2", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "1a2fd87e-92a3-48d4-989e-b6f0620832a2"}
:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e00:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa3false{:msg {:msg "Hello everybody!"}, :dream_id "d529be9d-20d8-4f7e-b975-bf33bdcb60e0", :msg_id #uuid "eaea0a85-f283-4e1e-99dd-e6a626f337e2", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "1a2fd87e-92a3-48d4-989e-b6f0620832a2"}
:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e00dream_idtrue{:msg {:msg "Hello everybody!"}, :dream_id "d529be9d-20d8-4f7e-b975-bf33bdcb60e0", :msg_id #uuid "eaea0a85-f283-4e1e-99dd-e6a626f337e2", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "1a2fd87e-92a3-48d4-989e-b6f0620832a2"}
:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa30:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa3false"dream not found"
:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa30dream not foundtrue"dream not found"
(dt:get-dream client=2)

Add a friend to a dream

dream-stuff
Profile not foundadd-friendprofile-ida1a1a1a1-b2b2-c3c3-d4d4-e5e5e5e5e5e5result?
successadd-friendprofile-id:profile-id2 => 1a2fd87e-92a3-48d4-989e-b6f0620832a2result?
Friend already in dreamadd-friendprofile-id:profile-id2 => 1a2fd87e-92a3-48d4-989e-b6f0620832a2result?
Dreams can't have more than 1 friend. Yours has 1add-friendprofile-id:profile-id3 => 66153075-fd27-4bda-9c23-449902fe4b63result?
(function: client=1, dream-id=:dream-id1)

Our friend (profile-id2) should have access to our dream (dream-id1)

idmsg-idxsubstrcontains?msg?
:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e00:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e0true{:msg {:msg "Hello everybody!"}, :dream_id "d529be9d-20d8-4f7e-b975-bf33bdcb60e0", :msg_id #uuid "eaea0a85-f283-4e1e-99dd-e6a626f337e2", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "1a2fd87e-92a3-48d4-989e-b6f0620832a2"}
:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e00:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa3false{:msg {:msg "Hello everybody!"}, :dream_id "d529be9d-20d8-4f7e-b975-bf33bdcb60e0", :msg_id #uuid "eaea0a85-f283-4e1e-99dd-e6a626f337e2", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "1a2fd87e-92a3-48d4-989e-b6f0620832a2"}
:dream-id2 -> d529be9d-20d8-4f7e-b975-bf33bdcb60e00dream_idtrue{:msg {:msg "Hello everybody!"}, :dream_id "d529be9d-20d8-4f7e-b975-bf33bdcb60e0", :msg_id #uuid "eaea0a85-f283-4e1e-99dd-e6a626f337e2", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "1a2fd87e-92a3-48d4-989e-b6f0620832a2"}
:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa30:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa3true{:msg {:msg "Hello everybody!"}, :dream_id "15baf7a6-9462-4aa9-af15-87b176630fa3", :msg_id #uuid "850f13b3-3292-4baf-9de4-b54f9507d2bd", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "c6b02b75-d956-4f89-824a-4629e4dd8149"}
:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa30dream_idtrue{:msg {:msg "Hello everybody!"}, :dream_id "15baf7a6-9462-4aa9-af15-87b176630fa3", :msg_id #uuid "850f13b3-3292-4baf-9de4-b54f9507d2bd", :prev_index 0, :_idx 1, :_message_type "dream_add_message", :_user_id "c6b02b75-d956-4f89-824a-4629e4dd8149"}
(dt:get-dream client=2)

But only the dream owner should be able to add friends!

dream-stuff
You can't add a friend to this dreamadd-friendprofile-id:profile-id3 => 66153075-fd27-4bda-9c23-449902fe4b63result?
(function: client=2, dream-id=:dream-id1)

And don't even try to send things that aren't GUIDs

dream-stuff
Profile ID must be a UUIDadd-friendprofile-idbad-profile-iddream-id:dream-id1 => 15baf7a6-9462-4aa9-af15-87b176630fa3result?
Dream ID must be a UUIDadd-friendprofile-id:profile-id3 => 66153075-fd27-4bda-9c23-449902fe4b63dream-idbad-dream-idresult?
(function: client=1)

Remove my friend from my dream

dream-stuff
successremove-friendprofile-id:profile-id2 => 1a2fd87e-92a3-48d4-989e-b6f0620832a2result?
Friend not in dreamremove-friendprofile-id:profile-id2 => 1a2fd87e-92a3-48d4-989e-b6f0620832a2result?
(function: client=1, dream-id=:dream-id1)
idmsg-idxsubstrcontains?msg?
:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa30:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa3false"dream not found"
:dream-id1 -> 15baf7a6-9462-4aa9-af15-87b176630fa30dream not foundtrue"dream not found"
(dt:get-dream client=2)

Etc.

server stuff
stoppedstop-serverport:port => 3001result?
(function:)