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

@@ -13,7 +13,7 @@ class ForumPostsControllerTest < ActionDispatch::IntegrationTest
context "with votes" do
setup do
as_user do
@tag_alias = create(:tag_alias, forum_post: @forum_post, status: "pending")
@bulk_update_request = create(:bulk_update_request, forum_post: @forum_post)
@vote = create(:forum_post_vote, forum_post: @forum_post, score: 1)
@forum_post.reload
end
@@ -29,10 +29,10 @@ class ForumPostsControllerTest < ActionDispatch::IntegrationTest
assert_select "li.vote-score-up"
end
context "after the alias is rejected" do
context "after the BUR is rejected" do
setup do
as(@mod) do
@tag_alias.reject!
@bulk_update_request.reject!
end
get_auth forum_topic_path(@forum_topic), @mod
end

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