diff --git a/spec/features/family_spec.rb b/spec/features/family_spec.rb index 9ea764a97c..9d4f6eb8a6 100644 --- a/spec/features/family_spec.rb +++ b/spec/features/family_spec.rb @@ -21,7 +21,7 @@ fill_in 'family[family_members_attributes][0][adult_name]', with: 'Test' find(".family_family_members_gender select option[value='female']", visible: false).select_option click_link 'Save' - sleep 5 + wait_for_ajax expect(page).to have_content('Family Name') expect(page).to have_content('Test') end diff --git a/spec/features/report_builder_spec.rb b/spec/features/report_builder_spec.rb index 37f2bb0170..ec278599dd 100644 --- a/spec/features/report_builder_spec.rb +++ b/spec/features/report_builder_spec.rb @@ -11,7 +11,8 @@ scenario 'for client' do visit clients_path find('.client-search').click - expect(page).to have_content('Search') + expect(page).to have_content('Given Name (Latin)') + fill_in 'Given Name (Latin)', with: 'Adam' find('#client-grid-search-btn').click wait_for_ajax() expect(page).to have_content("Adam") @@ -22,6 +23,7 @@ let!(:family){ create(:family, children: [client.id] ) } scenario 'for family' do visit families_path + fill_in 'Family ID', with: family.id find('#client-grid-search-btn').click wait_for_ajax() expect(page).to have_content(family.id)