Sha256: 3ff4b5c781b62fa24751a718ccd682f49d379d1ed808d53bd047b8e9b83756d6

Contents?: true

Size: 881 Bytes

Versions: 1

Compression:

Stored size: 881 Bytes

Contents

# frozen_string_literal: true

if ENV.key?('WITH_GIPHY_CLIENT')
  describe Giphy do
    before do
      ENV['GIPHY_API_KEY'] = 'giphy-api-key'
    end
    after do
      ENV.delete('GIPHY_API_KEY')
    end
    context 'rated g' do
      let(:burrito_gif) { 'https://media2.giphy.com/media/ImpBgQl7zzrO0/giphy.gif' }
      it 'random', vcr: { cassette_name: 'giphy_client_burrito' } do
        expect(Giphy.random('burrito').image_url).to eq burrito_gif
      end
    end
    context 'rated pg' do
      before do
        Giphy.config.rating = 'PG'
      end
      after do
        Giphy.config.rating = 'G'
      end
      let(:burrito_gif) { 'https://media0.giphy.com/media/3o6gb3OJb2tWB76uwE/giphy.gif' }
      it 'random', vcr: { cassette_name: 'giphy_client_burrito_rated_pg' } do
        expect(Giphy.random('burrito').image_url).to eq burrito_gif
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slack-ruby-bot-0.15.0 spec/slack-ruby-bot/initializers/giphy_client_spec.rb