Sha256: 09d431440e1dbb0f8b631ba1987f2c3d976ebde41d116533ea0e2d781a0dd92f

Contents?: true

Size: 693 Bytes

Versions: 3

Compression:

Stored size: 693 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe EndiFeed do
  let(:endi) { EndiFeed }

  before :each do
    stub_request(:get, 'http://www.elnuevodia.com/rss/noticias.xml')
    .with(:headers => { 'Accept' => '*/*', 'User-Agent' => 'Ruby' })
    .to_return(:status => 200, :body => fixture('noticias.xml'), :headers => {})

    stub_request(:post, 'https://www.googleapis.com/urlshortener/v1/url')
    .with(:headers => { 'Accept' => '*/*', 'User-Agent' => 'Ruby' })
    .to_return(:status => 200, :body => 'http://goo.gl/fbsS', :headers => {})
  end

  describe '.get_news' do
    it 'delegates to ::News.new.get_headlines' do
      expect(endi.get_news(2).size).to eq(4)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
endi_feed-0.0.3 spec/lib/endi_feed_spec.rb
endi_feed-0.0.2 spec/lib/endi_feed_spec.rb
endi_feed-0.0.1 spec/lib/endi_feed_spec.rb