File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,9 +16,28 @@ class CommentThreadTest < ActiveSupport::TestCase
1616 end
1717 end
1818
19- test 'last_activity should correctly get the thread\'s last activity date & time' do
19+ test 'remove_follower should correctly bump last_activity' do
20+ std_usr = users ( :standard_user )
2021 thread = comment_threads ( :without_activity )
22+ assert_equal thread . created_at , thread . last_activity
23+
24+ thread . add_follower ( std_usr )
25+ thread . reload
26+ last_activity_after_follow = thread . last_activity
27+
28+ thread . remove_follower ( std_usr )
29+ thread . reload
30+ last_activity_after_unfollow = thread . last_activity
31+ assert_operator last_activity_after_follow , '<' , last_activity_after_unfollow
32+
33+ thread . remove_follower ( std_usr )
34+ thread . reload
35+ last_activity_after_noop = thread . last_activity
36+ assert_operator last_activity_after_unfollow , '<' , last_activity_after_noop
37+ end
2138
39+ test 'last_activity should correctly get the thread\'s last activity date & time' do
40+ thread = comment_threads ( :without_activity )
2241 assert_equal thread . created_at , thread . last_activity
2342
2443 thread . update! ( title : 'this should bump last_activity' )
You can’t perform that action at this time.
0 commit comments