From 1b9c80d1ce943e97d739281b90093f27d1295356 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 5 Mar 2012 19:28:23 -0500 Subject: [PATCH] Correcting the map crawler spec (derp!) --- rails/map-mash/spec/lib/map_crawler_spec.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/rails/map-mash/spec/lib/map_crawler_spec.rb b/rails/map-mash/spec/lib/map_crawler_spec.rb index 75ac602..3dd187a 100644 --- a/rails/map-mash/spec/lib/map_crawler_spec.rb +++ b/rails/map-mash/spec/lib/map_crawler_spec.rb @@ -5,12 +5,15 @@ describe MapCrawler do let(:subject) { MapCrawler.new(Setting.map(:base_url)) } describe 'when crawling for actual maps', :integration => true do - before(:each) do - Map.destroy_all - end + it 'should increment the map count for each map found' do + map_count = 0 + count_increment = lambda do |n| + map_count += 1 + end - it 'should create Map entries for each map found' do - expect { subject.crawl }.to change{ Map.count }.by_at_least(1) + expect do + subject.crawl(count_increment) + end.to change{ map_count }.by_at_least(26) end end end