Sha256: bb9cadb53474772f6a7e3ab55d1efd555df88bda9a66c74e72a013be2f3811ab

Contents?: true

Size: 842 Bytes

Versions: 3

Compression:

Stored size: 842 Bytes

Contents

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 y' do
      before do
        Giphy.config.rating = 'Y'
      end
      after do
        Giphy.config.rating = 'G'
      end
      let(:burrito_gif) { 'https://media3.giphy.com/media/hkdKLmIgB3ane/giphy.gif' }
      it 'random', vcr: { cassette_name: 'giphy_client_burrito_rated_y' } do
        expect(Giphy.random('burrito').image_url).to eq burrito_gif
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slack-ruby-bot-0.12.0 spec/slack-ruby-bot/initializers/giphy_client_spec.rb
slack-ruby-bot-0.11.2 spec/slack-ruby-bot/initializers/giphy_client_spec.rb
slack-ruby-bot-0.11.1 spec/slack-ruby-bot/initializers/giphy_client_spec.rb