@@ -67,13 +67,16 @@ describe "api", ->
67
67
status, res = request_with_key " /api/1/my-streaks"
68
68
assert . same 200 , status
69
69
assert . same {
70
- upcoming : {}
71
- active : {}
72
- completed : {}
70
+ hosted : {}
71
+ joined : {
72
+ upcoming : {}
73
+ active : {}
74
+ completed : {}
75
+ }
73
76
} , res
74
77
75
78
76
- it " should get my-streaks with streaks" , ->
79
+ it " should get my-streaks with joined streaks" , ->
77
80
s1 = factory. Streaks state : " before_start"
78
81
s2 = factory. Streaks state : " after_end"
79
82
s3 = factory. Streaks state : " during"
@@ -84,7 +87,12 @@ describe "api", ->
84
87
status, res = request_with_key " /api/1/my-streaks"
85
88
assert . same 200 , status
86
89
87
- assert . same {} , res. active
88
- assert . same { s1. id} , [ s. id for s in * res. upcoming]
89
- assert . same { s2. id} , [ s. id for s in * res. completed]
90
+ assert . same {} , res. joined. active
91
+ assert . same { s1. id} , [ s. id for s in * res. joined. upcoming]
92
+ assert . same { s2. id} , [ s. id for s in * res. joined. completed]
93
+
94
+ it " should get my-streaks with hosted streaks" , ->
95
+ s = factory. Streaks state : " before_start" , user_id : current_user. id
96
+ status, res = request_with_key " /api/1/my-streaks"
97
+ assert . same { s. id} , [ s. id for s in * res. hosted]
90
98
0 commit comments