Sha256: 2633141d8eeb1c8bccd47b0bfafd20b3e624bc09f8b060c416e0829018ada465

Contents?: true

Size: 675 Bytes

Versions: 15

Compression:

Stored size: 675 Bytes

Contents

# frozen_string_literal: true

if defined?(RSpec)
  RSpec.shared_examples 'a valid backend for the questionnaires api' do
    let(:api) { Quby::Questionnaires::API.new(questionnaire_repo: repo) }

    it 'supports finding a questionnaire' do
      expect(api.find('simple').key).to eq('simple')
    end

    it 'supports checking whether a questionnaire exists' do
      expect(api.exists? 'simple').to be_truthy
      expect(api.exists? 'inexistant_questionnaire').to be_falsey
    end

    it 'supports finding all questionnaires' do
      expect(api.all.map(&:key)).to include('simple')
      expect(api.all.map(&:key)).to include('simple_with_outcome')
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
quby-5.6.5 lib/quby/questionnaires/specs/api_specs.rb
quby-5.6.3 lib/quby/questionnaires/specs/api_specs.rb
quby-5.6.2 lib/quby/questionnaires/specs/api_specs.rb
quby-5.6.1 lib/quby/questionnaires/specs/api_specs.rb
quby-5.6.0 lib/quby/questionnaires/specs/api_specs.rb
quby-5.5.0 lib/quby/questionnaires/specs/api_specs.rb
quby-5.4.0 lib/quby/questionnaires/specs/api_specs.rb
quby-5.3.1 lib/quby/questionnaires/specs/api_specs.rb
quby-5.3.0 lib/quby/questionnaires/specs/api_specs.rb
quby-5.2.0 lib/quby/questionnaires/specs/api_specs.rb
quby-5.1.3 lib/quby/questionnaires/specs/api_specs.rb
quby-5.1.2 lib/quby/questionnaires/specs/api_specs.rb
quby-5.1.1 lib/quby/questionnaires/specs/api_specs.rb
quby-5.1.0 lib/quby/questionnaires/specs/api_specs.rb
quby-5.0.5 lib/quby/questionnaires/specs/api_specs.rb