diff --git a/Gemfile b/Gemfile index 1a69fee0a9..4b909e05cb 100644 --- a/Gemfile +++ b/Gemfile @@ -89,6 +89,7 @@ group :test do gem 'ci_reporter', '1.8.4' gem 'rspec-rails', '2.10.1' gem 'poltergeist', '>= 1.0.0' + gem 'activerecord-nulldb-adapter', '0.3.1' end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index b7f395bbd0..ad47730b53 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -30,6 +30,8 @@ GEM activesupport (= 3.2.2) arel (~> 3.0.2) tzinfo (~> 0.3.29) + activerecord-nulldb-adapter (0.3.1) + activerecord (>= 2.0.0) activerecord-postgres-array (0.0.10) activerecord activerecord-postgresql-adapter (0.0.1) @@ -323,6 +325,7 @@ PLATFORMS ruby DEPENDENCIES + activerecord-nulldb-adapter (= 0.3.1) activerecord-postgres-array activerecord-postgresql-adapter addressable (= 2.3.2) diff --git a/services/importer/spec/unit/namedplaces_guesser_spec.rb b/services/importer/spec/unit/namedplaces_guesser_spec.rb index a7320f8c98..d07ecf274a 100644 --- a/services/importer/spec/unit/namedplaces_guesser_spec.rb +++ b/services/importer/spec/unit/namedplaces_guesser_spec.rb @@ -1,5 +1,6 @@ # encoding: utf-8 +require 'active_record' require_relative '../../lib/importer/namedplaces_guesser' RSpec.configure do |config| @@ -10,6 +11,10 @@ module CartoDB::Importer2 describe NamedplacesGuesser do + before(:all) do + ActiveRecord::Base.establish_connection :adapter => :nulldb + end + describe '#found?' do it 'raises an exception if not run yet' do content_guesser = mock @@ -101,7 +106,6 @@ module CartoDB::Importer2 describe '#namedplace_guess_country' do it "checks all candidates for a positive country guess through the geocoder api" do - pending 'make sure it can be tested without setting up connection with active record' content_guesser = mock namedplaces = NamedplacesGuesser.new(content_guesser) @@ -143,7 +147,6 @@ module CartoDB::Importer2 describe '#count_namedplaces_with_country_column' do it 'queries the geocoder to get the number of namedplaces from the sample' do - pending 'make sure it can be tested without setting up connection with active record' content_guesser = mock namedplaces = NamedplacesGuesser.new(content_guesser)