forum topics: don't record a topic visit for api requests.
This commit is contained in:
@@ -56,6 +56,16 @@ class ForumTopicsControllerTest < ActionController::TestCase
|
||||
get :show, {:id => @forum_topic.id}
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "record a topic visit for html requests" do
|
||||
get :show, {id: @forum_topic.id}, {user_id: @user.id}
|
||||
assert_not_nil(@user.reload.last_forum_read_at)
|
||||
end
|
||||
|
||||
should "not record a topic visit for non-html requests" do
|
||||
get :show, {id: @forum_topic.id, format: :json}, {user_id: @user.id}
|
||||
assert_nil(@user.reload.last_forum_read_at)
|
||||
end
|
||||
end
|
||||
|
||||
context "index action" do
|
||||
|
||||
Reference in New Issue
Block a user