blob: 64769a7b36ba8885f2339ee821e8d18f58051cf0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# frozen_string_literal: true
require 'test_helper'
class Topics::Polls::VotersControllerTest < ActionController::TestCase
setup do
@topic = create(:topic_with_poll)
@forum = @topic.forum
@request.cookies['_ses'] = 'c1836832948'
end
test 'should not list voters when unauthenticated' do
get :index, params: { forum_id: @forum, topic_id: @topic }
assert_response :redirect
assert_redirected_to root_url
end
test 'should list voters when authenticated' do
@user = create(:moderator)
sign_in @user
get :index, params: { forum_id: @forum, topic_id: @topic }
assert_response :success
end
end
|