|
728 | 728 | end |
729 | 729 |
|
730 | 730 | it 'updates proximity precision' do |
731 | | - update_task = index.update_proximity_precision('byAttribute') |
732 | | - client.wait_for_task(update_task['taskUid']) |
733 | | - |
| 731 | + index.update_proximity_precision('byAttribute').await |
734 | 732 | expect(index.proximity_precision).to eq('byAttribute') |
735 | 733 | end |
736 | 734 |
|
737 | 735 | it 'resets proximity precision' do |
738 | | - update_task = index.update_proximity_precision('byAttribute') |
739 | | - client.wait_for_task(update_task['taskUid']) |
740 | | - |
741 | | - reset_task = index.reset_proximity_precision |
742 | | - client.wait_for_task(reset_task['taskUid']) |
| 736 | + index.update_proximity_precision('byAttribute').await |
| 737 | + expect(index.proximity_precision).to eq('byAttribute') |
743 | 738 |
|
| 739 | + index.reset_proximity_precision.await |
744 | 740 | expect(index.proximity_precision).to eq('byWord') |
745 | 741 | end |
746 | 742 | end |
|
757 | 753 | end |
758 | 754 |
|
759 | 755 | it '#update_search_cutoff_ms updates default value' do |
760 | | - update_task = index.update_search_cutoff_ms(800) |
761 | | - client.wait_for_task(update_task['taskUid']) |
762 | | - |
| 756 | + index.update_search_cutoff_ms(800).await |
763 | 757 | expect(index.search_cutoff_ms).to eq(800) |
764 | 758 | end |
765 | 759 |
|
766 | 760 | it '#reset_search_cutoff_ms resets search cutoff ms' do |
767 | | - update_task = index.update_search_cutoff_ms(300) |
768 | | - client.wait_for_task(update_task['taskUid']) |
769 | | - |
| 761 | + index.update_search_cutoff_ms(300).await |
770 | 762 | expect(index.search_cutoff_ms).to eq(300) |
771 | 763 |
|
772 | | - reset_task = index.reset_search_cutoff_ms |
773 | | - client.wait_for_task(reset_task['taskUid']) |
774 | | - |
| 764 | + index.reset_search_cutoff_ms.await |
775 | 765 | expect(index.search_cutoff_ms).to eq(default_search_cutoff_ms) |
776 | 766 | end |
777 | 767 | end |
|
787 | 777 | end |
788 | 778 |
|
789 | 779 | it '#update_localized_attributes updates default value' do |
790 | | - update_task = index.update_localized_attributes([{ attribute_patterns: ['title'], locales: ['eng'] }]) |
791 | | - client.wait_for_task(update_task['taskUid']) |
| 780 | + index.update_localized_attributes( |
| 781 | + [{ attribute_patterns: ['title'], locales: ['eng'] }] |
| 782 | + ).await |
792 | 783 |
|
793 | | - expect(index.localized_attributes).to eq([{ 'attributePatterns' => ['title'], 'locales' => ['eng'] }]) |
| 784 | + expect(index.localized_attributes).to eq( |
| 785 | + [{ 'attributePatterns' => ['title'], 'locales' => ['eng'] }] |
| 786 | + ) |
794 | 787 | end |
795 | 788 |
|
796 | 789 | it '#reset_localized_attributes resets localized attributes' do |
797 | | - update_task = index.update_localized_attributes([{ attribute_patterns: ['title'], locales: ['eng'] }]) |
798 | | - client.wait_for_task(update_task['taskUid']) |
799 | | - |
800 | | - expect(index.localized_attributes).to eq([{ 'attributePatterns' => ['title'], 'locales' => ['eng'] }]) |
| 790 | + index.update_localized_attributes( |
| 791 | + [{ attribute_patterns: ['title'], locales: ['eng'] }] |
| 792 | + ).await |
801 | 793 |
|
802 | | - reset_task = index.reset_localized_attributes |
803 | | - client.wait_for_task(reset_task['taskUid']) |
| 794 | + expect(index.localized_attributes).to eq( |
| 795 | + [{ 'attributePatterns' => ['title'], 'locales' => ['eng'] }] |
| 796 | + ) |
804 | 797 |
|
| 798 | + index.reset_localized_attributes.await |
805 | 799 | expect(index.localized_attributes).to eq(default_localized_attributes) |
806 | 800 | end |
807 | 801 | end |
|
817 | 811 | end |
818 | 812 |
|
819 | 813 | it '#update_facet_search_setting updates default value' do |
820 | | - update_task = index.update_facet_search_setting(false) |
821 | | - client.wait_for_task(update_task['taskUid']) |
822 | | - |
| 814 | + index.update_facet_search_setting(false).await |
823 | 815 | expect(index.facet_search_setting).to eq(false) |
824 | 816 | end |
825 | 817 |
|
826 | 818 | it '#reset_facet_search_setting resets facet search' do |
827 | | - update_task = index.update_facet_search_setting(false) |
828 | | - client.wait_for_task(update_task['taskUid']) |
829 | | - |
| 819 | + index.update_facet_search_setting(false).await |
830 | 820 | expect(index.facet_search_setting).to eq(false) |
831 | 821 |
|
832 | | - reset_task = index.reset_facet_search_setting |
833 | | - client.wait_for_task(reset_task['taskUid']) |
834 | | - |
| 822 | + index.reset_facet_search_setting.await |
835 | 823 | expect(index.facet_search_setting).to eq(default_facet_search_setting) |
836 | 824 | end |
837 | 825 | end |
|
847 | 835 | end |
848 | 836 |
|
849 | 837 | it '#update_prefix_search updates default value' do |
850 | | - update_task = index.update_prefix_search('disabled') |
851 | | - client.wait_for_task(update_task['taskUid']) |
852 | | - |
| 838 | + index.update_prefix_search('disabled').await |
853 | 839 | expect(index.prefix_search).to eq('disabled') |
854 | 840 | end |
855 | 841 |
|
856 | 842 | it '#reset_prefix_search resets prefix search' do |
857 | | - update_task = index.update_prefix_search('disabled') |
858 | | - client.wait_for_task(update_task['taskUid']) |
859 | | - |
| 843 | + index.update_prefix_search('disabled').await |
860 | 844 | expect(index.prefix_search).to eq('disabled') |
861 | 845 |
|
862 | | - reset_task = index.reset_prefix_search |
863 | | - client.wait_for_task(reset_task['taskUid']) |
864 | | - |
| 846 | + index.reset_prefix_search.await |
865 | 847 | expect(index.prefix_search).to eq(default_prefix_search) |
866 | 848 | end |
867 | 849 | end |
|
878 | 860 | end |
879 | 861 |
|
880 | 862 | it '#update_embedders updates default value' do |
881 | | - update_task = index.update_embedders( |
| 863 | + index.update_embedders( |
882 | 864 | custom: { |
883 | 865 | source: 'userProvided', |
884 | 866 | dimensions: 3 |
885 | 867 | } |
886 | | - ) |
887 | | - client.wait_for_task(update_task['taskUid']) |
| 868 | + ).await |
888 | 869 |
|
889 | 870 | expect(index.embedders).to have_key('custom') |
890 | 871 | end |
891 | 872 |
|
892 | 873 | it '#reset_embedders resets embedders to nil' do |
893 | | - update_task = index.update_embedders( |
| 874 | + index.update_embedders( |
894 | 875 | custom: { |
895 | 876 | source: 'userProvided', |
896 | 877 | dimensions: 3 |
897 | 878 | } |
898 | | - ) |
899 | | - client.wait_for_task(update_task['taskUid']) |
| 879 | + ).await |
900 | 880 |
|
901 | 881 | expect(index.embedders).to have_key('custom') |
902 | 882 |
|
903 | | - reset_task = index.reset_embedders |
904 | | - client.wait_for_task(reset_task['taskUid']) |
905 | | - |
| 883 | + index.reset_embedders.await |
906 | 884 | expect(index.embedders).to eq(default_embedders) |
907 | 885 | end |
908 | 886 | end |
|
0 commit comments