Commit 10826f6c by Saqib

fix merge conflicts

parents ee9539c4 33b2bd8d
...@@ -25,6 +25,3 @@ Bill DeRusha <bill@edx.org> ...@@ -25,6 +25,3 @@ Bill DeRusha <bill@edx.org>
Brian Beggs <macdiesel@gmail.com> Brian Beggs <macdiesel@gmail.com>
Clinton Blackburn <cblackburn@edx.org> Clinton Blackburn <cblackburn@edx.org>
Eugeny Kolpakov <eugeny.kolpakov@gmail.com> Eugeny Kolpakov <eugeny.kolpakov@gmail.com>
Ben McMorran <ben.mcmorran@gmail.com>
Bill DeRusha <bill@edx.org>
Eugeny Kolpakov <eugeny.kolpakov@gmail.com>
...@@ -574,6 +574,31 @@ describe "app" do ...@@ -574,6 +574,31 @@ describe "app" do
json_response["read"].should == true json_response["read"].should == true
end end
# Test active and non active thread count for a course
it "test the number of active and non active threads for a course" do
User.all.delete
Content.all.delete
@user = create_test_user(999)
@threads = {}
5.times do |n|
thread_key = "t#{n}"
thread = make_thread(@user, thread_key, DFLT_COURSE_ID, "pdq")
@threads[n] = thread
end
time_threshold = 2.day.ago
@threads[0].last_activity_at = time_threshold
@threads[0].save!
@threads[1].last_activity_at = time_threshold
@threads[1].save!
get "/api/v1/courses/#{DFLT_COURSE_ID}/stats"
last_response.should be_ok
response = parse last_response.body
response["num_threads"].should == 5
response["num_active_threads"].should == 3
end
def test_unicode_data(text) def test_unicode_data(text)
thread = create(:comment_thread, body: text) thread = create(:comment_thread, body: text)
create(:comment, comment_thread: thread, body: text) create(:comment, comment_thread: thread, body: text)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment