2016-09-08 10:25:33 -05:00
|
|
|
# frozen_string_literal: true
|
2016-08-04 20:12:14 -05:00
|
|
|
require 'test_helper'
|
|
|
|
|
2016-08-07 09:36:08 -05:00
|
|
|
class QuestionAttachmentsTest < ActionDispatch::IntegrationTest
|
2016-08-04 20:12:14 -05:00
|
|
|
test "should show attachments on question" do
|
2016-09-14 17:05:37 -05:00
|
|
|
auth_candidate candidates(:dawn)
|
2016-08-04 20:12:14 -05:00
|
|
|
|
|
|
|
get question_path questions(:fed6)
|
|
|
|
assert_response :success
|
|
|
|
assert_select '.question-text', questions(:fed6).question
|
|
|
|
assert_select "img[src=\"#{questions(:fed6).attachment}\"]"
|
|
|
|
end
|
|
|
|
|
|
|
|
test "should show attachments on summary" do
|
2016-09-14 17:05:37 -05:00
|
|
|
auth_candidate candidates(:dawn)
|
2016-08-04 20:12:14 -05:00
|
|
|
|
|
|
|
get summary_path
|
|
|
|
assert_response :success
|
|
|
|
assert_select "img[src=\"#{questions(:fed6).attachment}\"]"
|
|
|
|
end
|
|
|
|
|
2016-08-17 14:26:54 -05:00
|
|
|
test "should show attachments on review" do
|
2016-09-22 14:19:44 -05:00
|
|
|
auth_reviewer
|
2016-08-17 14:26:54 -05:00
|
|
|
|
2016-09-22 14:19:44 -05:00
|
|
|
get admin_result_path(candidates(:richard).test_hash)
|
2016-08-17 14:26:54 -05:00
|
|
|
assert_response :success
|
|
|
|
assert_select "img[src=\"#{questions(:fed6).attachment}\"]"
|
|
|
|
end
|
2016-08-04 20:12:14 -05:00
|
|
|
end
|