Sha256: 46ad59687cbf4fcd699da2bbd775602df7d4af1eb28b4586df1b8d1ba5f51537

Contents?: true

Size: 852 Bytes

Versions: 3

Compression:

Stored size: 852 Bytes

Contents

require 'spec_helper'
require 'feedshub/feeds/git_feeds_handler'

describe GitFeedsHandler do

  describe '.retrieve_org_members_links' do

    before :each do
      RestClient.stub(:get).and_return(File.read('spec/resources/members.json'))
    end

    it 'retrieves the members links of the organization as an array' do
      expect(GitFeedsHandler.retrieve_org_members_links.class.name).to eq('Array')
    end

    it 'verify members is not empty' do
      expect(GitFeedsHandler.retrieve_org_members_links).not_to be_empty
    end

  end

  describe '.fetch_and_create_feeds_enrties' do

    let(:links) { ["File://#{Rails.root}/spec/resources/member.atom"] }

    it 'has to fetch entries from feeds' do
      expect{ GitFeedsHandler.fetch_and_create_feeds_enrties(links) }.to change{ Feedshub::GithubFeedEntry.count }.by(11)
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
feedshub-1.0.2 spec/dummy/spec/lib/git_feeds_handler_spec.rb
feedshub-1.0.1 spec/dummy/spec/lib/git_feeds_handler_spec.rb
feedshub-1.0.0 spec/dummy/spec/lib/git_feeds_handler_spec.rb