Sha256: 4e3c49a23a76d54b47ba86881c5deb643cc5b89023f4f2e7bef9259d856a9cc9

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

ENV['RAILS_ENV'] ||= 'test'

# Generate Simplecov report
require 'simplecov'
SimpleCov.start

require File.expand_path('dummy/config/environment.rb', __dir__)
require 'rspec/rails'
require 'shoulda/matchers'
require 'webmock/rspec'

require 'europeana/api'
Europeana::API.logger.level = Logger::ERROR

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

RSpec.configure do |config|
  config.infer_spec_type_from_file_location!

  config.order = 'random'

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  config.before(:each) do
    stub_request(:get, %r{https://www.europeana.eu/api/v2/record/[^/]+/[^/.]+\.json}).
      with(query: hash_including(:wskey)).
      to_return(body: '{"success":true}', headers: { 'content-type' => 'application/json' })

    stub_request(:get, 'https://www.europeana.eu/api/v2/search.json').
      with(query: hash_including(:wskey, :query)).
      to_return(body: '{"success":true}', headers: { 'content-type' => 'application/json' })
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
europeana-blacklight-1.3.1 spec/spec_helper.rb
europeana-blacklight-1.3.0 spec/spec_helper.rb