Sha256: 9c4bc37b9522d8bf62b635e6d43c1350baa9752bb625a7b29f15859138e5e20a

Contents?: true

Size: 922 Bytes

Versions: 8

Compression:

Stored size: 922 Bytes

Contents

require 'spec_helper'
require 'meetupinator/event_finder'
require 'meetupinator/meetup_api'

describe Meetupinator::EventFinder do
  describe '#extract_events' do
    let(:meetups) do
      {
        'first' => 101,
        'second' => 201,
        'third' => 301
      }
    end

    let(:events) { [:first_event, :another_event, :more_events, :final_event] }
    let(:events_in_week) { [:event_in_week] }

    let(:api) { instance_double(Meetupinator::MeetupAPI) }

    before do
      allow(api).to receive(:get_meetup_id) { |name| meetups[name] }
      allow(api).to receive(:get_upcoming_events).with(meetups.values, nil) { events }
      allow(api).to receive(:get_upcoming_events).with(meetups.values, true) { events_in_week }
    end

    it { expect(subject.extract_events(meetups.keys, api, nil)).to eq(events) }
    it { expect(subject.extract_events(meetups.keys, api, true)).to eq(events_in_week) }
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
meetupinator-0.8.1 spec/lib/meetupinator/event_finder_spec.rb
meetupinator-0.8 spec/lib/meetupinator/event_finder_spec.rb
meetupinator-0.7.1 spec/lib/meetupinator/event_finder_spec.rb
meetupinator-0.7 spec/lib/meetupinator/event_finder_spec.rb
meetupinator-0.6.2 spec/lib/meetupinator/event_finder_spec.rb
meetupinator-0.6.1 spec/lib/meetupinator/event_finder_spec.rb
meetupinator-0.6 spec/lib/meetupinator/event_finder_spec.rb
meetupinator-0.5 spec/lib/meetupinator/event_finder_spec.rb