skill-assessment-app/test/integration/question_attachments_test.rb
Mark Moser 4bbd93ded1 rubocop noise: fixes FrozenStringLiteralComment
Adding the .ruby-verison file triggered previously un-run cops, specifically:

  This cop is designed to help upgrade to Ruby 3.0. It will add the
  comment `# frozen_string_literal: true` to the top of files to enable
  frozen string literals. Frozen string literals will be default in Ruby
  3.0. The comment will be added below a shebang and encoding comment. The
  frozen string literal comment is only valid in Ruby 2.3+.

More info on rubocop [Automatic-Corrections](https://github.com/bbatsov/rubocop/wiki/Automatic-Corrections)
2016-09-08 10:30:13 -05:00

35 lines
1.0 KiB
Ruby

# frozen_string_literal: true
require 'test_helper'
class QuestionAttachmentsTest < ActionDispatch::IntegrationTest
def setup_auth candidate
post validate_candidate_url, params: { test_id: candidate.test_hash }
end
test "should show attachments on question" do
setup_auth candidates(:dawn)
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
setup_auth candidates(:dawn)
get summary_path
assert_response :success
assert_select "img[src=\"#{questions(:fed6).attachment}\"]"
end
test "should show attachments on review" do
user = users :reviewer
post review_auth_url, params: { auth: { email: user.email, password: 'password' } }
get review_test_path(candidates(:richard).test_hash)
assert_response :success
assert_select "img[src=\"#{questions(:fed6).attachment}\"]"
end
end