Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
66d867d4
Commit
66d867d4
authored
Aug 07, 2013
by
Kevin Chugh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix timing used on tests
parent
e839ef1f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
spec/api/notifications_spec.rb
+12
-4
No files found.
spec/api/notifications_spec.rb
View file @
66d867d4
...
...
@@ -28,6 +28,7 @@ describe "app" do
end_time
=
Time
.
now
post
"/api/v1/notifications"
,
from:
CGI
::
escape
(
start_time
.
to_s
),
to:
CGI
::
escape
(
end_time
.
to_s
),
user_ids:
subscription
.
subscriber_id
last_response
.
should
be_ok
last_response
.
body
.
to_s
.
include?
(
dummy
).
should
==
true
end
...
...
@@ -50,12 +51,14 @@ describe "app" do
comment
.
comment_thread
=
thread
comment
.
save!
start_time
=
Date
.
today
-
400
.
days
end_time
=
Time
.
now
start_time
=
Date
.
today
-
100
.
days
sleep
1
end_time
=
Time
.
now
+
5
.
seconds
post
"/api/v1/notifications"
,
from:
CGI
::
escape
(
start_time
.
to_s
),
to:
CGI
::
escape
(
end_time
.
to_s
),
user_ids:
user
.
id
last_response
.
should
be_ok
payload
=
JSON
.
parse
last_response
.
body
courses
=
payload
[
user
.
id
.
to_s
]
...
...
@@ -74,14 +77,17 @@ describe "app" do
end
it
"returns only unflagged threads"
do
start_time
=
Date
.
today
-
4
00
.
days
end_time
=
Time
.
now
start_time
=
Date
.
today
-
1
00
.
days
user
=
User
.
create
(
:email
=>
"test@example.com"
,
:external_id
=>
1
,
:username
=>
"example"
)
sleep
1
end_time
=
Time
.
now
+
5
.
seconds
post
"/api/v1/notifications"
,
from:
CGI
::
escape
(
start_time
.
to_s
),
to:
CGI
::
escape
(
end_time
.
to_s
),
user_ids:
user
.
id
last_response
.
should
be_ok
payload
=
JSON
.
parse
last_response
.
body
courses
=
payload
[
user
.
id
.
to_s
]
...
...
@@ -97,6 +103,8 @@ describe "app" do
sleep
1
end_time
=
Time
.
now
+
5
.
seconds
post
"/api/v1/notifications"
,
from:
CGI
::
escape
(
start_time
.
to_s
),
to:
CGI
::
escape
(
end_time
.
to_s
),
user_ids:
user
.
id
last_response
.
should
be_ok
payload
=
JSON
.
parse
last_response
.
body
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment