update feature specs

This commit is contained in:
bilal
2020-06-09 13:32:23 +02:00
parent ed312c186f
commit 2a6305b417

View File

@@ -138,26 +138,34 @@ feature 'User managing appearance releases' do
end
scenario 'progress bar shows when user imports a release', js: true do
skip "TODO"
visit project_appearance_releases_path(project)
attach_file import_appearance_release_field, Rails.root.join(file_fixture('person_photo.png')), visible: false
expect(page).to have_content importing_label
expect(page).not_to have_css('#upload-progress-container')
large_pdf_file = build_large_pdf_file
attach_file import_appearance_release_field, Rails.root.join(large_pdf_file.path), visible: false
expect(page).to have_css('#upload-progress-container')
click_button submit_create_button
expect(page).to have_css('.progress')
expect(page).to have_content matching_started
end
scenario 'importing a releases works when image is selected', js: true do
skip 'Will be changed according to new matching capability'
scenario 'no appearance releases are added if BrayniacAI returns no matches', js: true do
visit project_appearance_releases_path(project)
expect(page).to have_content submit_create_button
expect(page).to have_content no_appearance_releases
attach_file import_appearance_release_field, Rails.root.join(file_fixture('person_photo.png')), visible: false
expect(page).to have_content importing_label
click_button submit_create_button
expect(page).not_to have_content no_appearance_releases
expect(page).to have_content /Imported Headshot\s+\d{7}/
visit project_appearance_releases_path(project)
expect(page).to have_content no_appearance_releases
end
scenario 'incomplete appearance release is added if headshot 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('pratt_headshot_with_code.jpg')), visible: false
click_button submit_create_button
visit project_appearance_releases_path(project)
expect(page).to have_content no_appearance_releases
end
scenario 'importing a releases works when pdf is selected', js: true do
@@ -438,6 +446,10 @@ feature 'User managing appearance releases' do
tempfile
end
def matching_started
t 'appearance_releases.create.matching_started'
end
def filter_type_all
t 'appearance_releases.type_filter_actions.all_releases'
end