forum: fixup broken tests.

Fix tests broken by recent addition of BUR status indicators.
This commit is contained in:
evazion
2020-03-16 14:32:43 -05:00
parent 4b30e644bb
commit 9389fee726
2 changed files with 9 additions and 10 deletions

View File

@@ -132,46 +132,45 @@ class ForumTopicsControllerTest < ActionDispatch::IntegrationTest
context "when listing topics" do
should "always show topics as read for anonymous users" do
get forum_topics_path
assert_select "span.new", count: 0
assert_select 'tr[data-is-read="false"]', count: 0
end
should "show topics as read after viewing them" do
get_auth forum_topics_path, @user
assert_response :success
assert_select "span.new", count: 3
assert_select 'tr[data-is-read="false"]', count: 3
get_auth forum_topic_path(@forum_topic.id), @user
assert_response :success
get_auth forum_topics_path, @user
assert_response :success
assert_select "span.new", count: 2
end
should "show topics as read after marking all as read" do
get_auth forum_topics_path, @user
assert_response :success
assert_select "span.new", count: 3
assert_select 'tr[data-is-read="false"]', count: 3
post_auth mark_all_as_read_forum_topics_path, @user
assert_response 302
get_auth forum_topics_path, @user
assert_response :success
assert_select "span.new", count: 0
assert_select 'tr[data-is-read="false"]', count: 0
end
should "show topics on page 2 as read after marking all as read" do
get_auth forum_topics_path(page: 2, limit: 1), @user
assert_response :success
assert_select "span.new", count: 1
assert_select 'tr[data-is-read="false"]', count: 1
post_auth mark_all_as_read_forum_topics_path, @user
assert_response 302
get_auth forum_topics_path(page: 2, limit: 1), @user
assert_response :success
assert_select "span.new", count: 0
assert_select 'tr[data-is-read="false"]', count: 0
end
end
end