mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 23:31:18 +08:00
FEATURE: Button to reset new
This commit is contained in:
@ -811,4 +811,25 @@ describe TopicsController do
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe 'reset_new' do
|
||||
it 'needs you to be logged in' do
|
||||
lambda { xhr :put, :reset_new }.should raise_error(Discourse::NotLoggedIn)
|
||||
end
|
||||
|
||||
let(:user) { log_in(:user) }
|
||||
|
||||
it "updates the `new_since` date" do
|
||||
old_date = 2.years.ago
|
||||
|
||||
user.user_stat.update_column(:new_since, old_date)
|
||||
|
||||
xhr :put, :reset_new
|
||||
user.reload
|
||||
user.user_stat.new_since.to_date.should_not == old_date.to_date
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user