Sha256: 318dadd37195100157297aadeb8858e7fcbd0739fcc960078beb59e5623c6d2b
Contents?: true
Size: 1.16 KB
Versions: 10
Compression:
Stored size: 1.16 KB
Contents
# frozen_string_literal: true shared_examples_for '.search' do |attribute_hash_key_name, value, matches| describe '.search' do describe 'search' do context 'with no matches' do subject do VCR.use_cassette("#{vcr_dir}/search_miss") do repository.search(attribute_hash_key_name => 'nothing') end end it { is_expected.to be_instance_of(Array) } it { is_expected.to have(0).entries } end context "with #{matches} match(es)" do subject do VCR.use_cassette("#{vcr_dir}/search_by_name") do repository.search(attribute_hash_key_name => value) end end it { is_expected.to be_instance_of(Array) } it { is_expected.to have(matches).entries } end context 'with special characters' do subject do when_performing do VCR.use_cassette("#{vcr_dir}/search_with_special_char") do repository.search(attribute_hash_key_name => 'special char å') end end end it { is_expected.not_to raise_error } end end end end # rubocop:enable RSpec/DescribeClass
Version data entries
10 entries across 10 versions & 1 rubygems