From 3307f0ebe8090a85fbe02ad60f43d6317ed69bb8 Mon Sep 17 00:00:00 2001 From: bilal Date: Wed, 10 Jun 2020 03:34:55 +0200 Subject: [PATCH] update specs --- .../user_managing_appearance_releases_spec.rb | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/spec/features/user_managing_appearance_releases_spec.rb b/spec/features/user_managing_appearance_releases_spec.rb index eecca43..8dd09d4 100644 --- a/spec/features/user_managing_appearance_releases_spec.rb +++ b/spec/features/user_managing_appearance_releases_spec.rb @@ -162,10 +162,47 @@ feature 'User managing appearance releases' do visit project_appearance_releases_path(project) expect(page).to have_content no_appearance_releases - attach_file import_appearance_release_field, Rails.root.join(file_fixture('pratt_headshot_with_code.jpg')), visible: false + attach_file import_appearance_release_field, Rails.root.join(file_fixture('contract_1_headshot.jpg')), visible: false click_button submit_create_button visit project_appearance_releases_path(project) + expect(page).not_to have_content no_appearance_releases + end + + scenario 'incomplete appearance release is added if contract only is matched', js: true do + skip 'Will be updated' + visit project_appearance_releases_path(project) + expect(page).to have_content no_appearance_releases + attach_file import_appearance_release_field, Rails.root.join(file_fixture('contract_1.pdf')), visible: false + click_button submit_create_button + visit project_appearance_releases_path(project) + expect(page).not_to have_content no_appearance_releases + end + + scenario 'two incomplete appearance releases are added if uploaded contract and headshot have different identifier', js: true do + skip 'Will be updated' + visit project_appearance_releases_path(project) + + expect(page).to have_content no_appearance_releases + attach_file import_appearance_release_field, Rails.root.join(file_fixture('contract_1.pdf')), visible: false + attach_file import_appearance_release_field, Rails.root.join(file_fixture('contract_2_headshot.jpeg')), visible: false + click_button submit_create_button + visit project_appearance_releases_path(project) + expect(page).not_to have_content no_appearance_releases + expect(page).to have_content /Incomplete Contract\s+\d{7}/.twice + end + + scenario 'complete appearance release is added if uploaded contract and headshot have same identifier', js: true do + skip 'Will be updated' + visit project_appearance_releases_path(project) + + expect(page).to have_content no_appearance_releases + attach_file import_appearance_release_field, Rails.root.join(file_fixture('contract_1.pdf')), visible: false + attach_file import_appearance_release_field, Rails.root.join(file_fixture('contract_1_headshot.jpeg')), visible: false + click_button submit_create_button + visit project_appearance_releases_path(project) + expect(page).not_to have_content no_appearance_releases + expect(page).to have_content /Incomplete Contract\s+\d{7}/ end scenario 'importing a releases works when pdf is selected', js: true do