From badc3786dd93489f6735c6ad88c55a42e36e6058 Mon Sep 17 00:00:00 2001 From: bilal Date: Thu, 11 Jun 2020 15:09:46 +0200 Subject: [PATCH] update matching features specs --- .../user_managing_appearance_releases_spec.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/features/user_managing_appearance_releases_spec.rb b/spec/features/user_managing_appearance_releases_spec.rb index 37e15ba..bf8854a 100644 --- a/spec/features/user_managing_appearance_releases_spec.rb +++ b/spec/features/user_managing_appearance_releases_spec.rb @@ -148,11 +148,13 @@ feature 'User managing appearance releases' do expect(page).to have_content matching_started end - scenario 'no appearance releases are added if BrayniacAI returns no matches', js: true do + scenario 'MatchAppearanceReleasesJob is started when import is finished', js: true do visit project_appearance_releases_path(project) attach_file import_appearance_release_field, Rails.root.join(file_fixture('person_photo.png')), visible: false + allow(MatchAppearanceReleasesJob).to receive(:perform_later).with(project, anything) click_button submit_create_button + expect(page).to have_content matching_started visit project_appearance_releases_path(project) expect(page).to have_content no_appearance_releases end @@ -161,13 +163,11 @@ feature 'User managing appearance releases' do skip 'Will be updated' visit project_appearance_releases_path(project) - Sidekiq::Testing.inline! do - expect(page).to have_content no_appearance_releases - 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 + expect(page).to have_content no_appearance_releases + 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