Upstream sync

This commit is contained in:
Senad Uka
2020-08-20 06:50:51 +02:00
parent 190ff2854b
commit 41bf88e358
127 changed files with 1399 additions and 565 deletions

View File

@@ -137,11 +137,14 @@ feature "User managing medical releases" do
contract_template = create(:contract_template,
project: project,
question_1_text: 'Question 1',
question_2_text: 'Question 2'
question_2_text: 'Question 2',
questionnaire_legal_text: 'Questionnaire legal text',
)
visit new_account_project_contract_template_medical_release_path(project.account, project, contract_template)
expect(page).to have_content 'Questionnaire legal text'
fill_in person_first_name_field, with: 'Jane'
fill_in person_last_name_field, with: 'Doe'
draw_signature file_fixture("signature.png"), "medical_release_signature_base64"
@@ -287,6 +290,32 @@ feature "User managing medical releases" do
expect(pdf_body).not_to have_content date_issued
expect(pdf_body).not_to have_content 'Big Joe'
end
scenario 'viewing contract PDF with medical questionnaire' do
contract_template = create(:medical_release_contract_template, project: project, questionnaire_legal_text: "Questionnaire legal text", question_1_text: "Question 1 text")
medical_release = create(:medical_release,
:native,
contract_template: contract_template,
project: project,
person_first_name: "John",
person_last_name: "Doe",
question_1_answer: "Question 1 answer",
)
sign_in(current_user)
visit project_medical_releases_path(project)
click_link *view_release_pdf_link_for(medical_release)
expect(content_type).to eq("application/pdf")
expect(content_disposition).to include("inline")
expect(pdf_filename).to include("doe-john")
expect(pdf_body).to have_content("John Doe")
expect(pdf_body).to have_content "MEDICAL QUESTIONNAIRE"
expect(pdf_body).to have_content "Question 1 text"
expect(pdf_body).to have_content "Question 1 answer"
expect(pdf_body).to have_content "Questionnaire legal text"
end
end
context "when the user is manager(project manager)" do