diff --git a/.ruby-version b/.ruby-version index ccbccc3..a3ec5a4 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.2.0 +3.2 diff --git a/.travis.yml b/.travis.yml index 05f5678..f819a51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1 @@ language: ruby -rvm: - - "1.9.3" - - "2.2.0" diff --git a/Gemfile.lock b/Gemfile.lock index 50f950c..f1e1825 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,71 +1,71 @@ PATH remote: . specs: - chilean_cities (0.1.0) - activemodel (>= 3.2.11, < 5) + chilean_cities (0.1.1) + activemodel (>= 3.2.11) multi_json (~> 1.0) - rake (~> 10.4) + rake GEM remote: https://rubygems.org/ specs: - activemodel (4.2.0) - activesupport (= 4.2.0) - builder (~> 3.1) - activesupport (4.2.0) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - builder (3.2.2) - coderay (1.1.0) - diff-lcs (1.2.5) - factory_girl (4.5.0) - activesupport (>= 3.0.0) - i18n (0.7.0) + activemodel (7.0.6) + activesupport (= 7.0.6) + activesupport (7.0.6) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + coderay (1.1.3) + concurrent-ruby (1.2.2) + diff-lcs (1.5.0) + factory_bot (6.2.1) + activesupport (>= 5.0.0) + i18n (1.14.1) + concurrent-ruby (~> 1.0) inch (0.4.10) pry sparkr (>= 0.2.0) term-ansicolor yard (~> 0.8.7) - json (1.8.2) - method_source (0.8.2) - minitest (5.5.1) - multi_json (1.11.0) - pry (0.10.1) - coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - rake (10.4.2) - rspec (3.2.0) - rspec-core (~> 3.2.0) - rspec-expectations (~> 3.2.0) - rspec-mocks (~> 3.2.0) - rspec-core (3.2.0) - rspec-support (~> 3.2.0) - rspec-expectations (3.2.0) + method_source (1.0.0) + minitest (5.18.1) + multi_json (1.15.0) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) + rake (13.0.6) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.2) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.2.0) - rspec-mocks (3.2.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.2.0) - rspec-support (3.2.1) - slop (3.6.0) + rspec-support (~> 3.12.0) + rspec-support (3.12.1) sparkr (0.4.1) - term-ansicolor (1.3.0) + sync (0.5.0) + term-ansicolor (1.7.1) tins (~> 1.0) - thread_safe (0.3.4) - tins (1.3.4) - tzinfo (1.2.2) - thread_safe (~> 0.1) + tins (1.32.1) + sync + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) yard (0.8.7.6) PLATFORMS - ruby + arm64-darwin-22 DEPENDENCIES chilean_cities! - factory_girl (~> 4.5) + factory_bot inch (~> 0.4.6) rspec (~> 3.0) + +BUNDLED WITH + 2.4.15 diff --git a/README.md b/README.md index 7bf2d3f..7536c7f 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ This library is based on the publicly available information from the SUBDERE rel - Decreto Supremo No 1352, del Ministerio del Interior, publicado en el Diario Oficial del 23 de Agosto de 2008 - Decreto Exento No 910, del Ministerio del Interior, publicado en el Diario Oficial del 14 de Junio de 2007 - Decreto Exento No 817, del Ministerio del Interior, publicado en el Diario Oficial del 26 de Marzo de 2010 +- Decreto Exento No 204, del Ministerio del Interior, publicado en el Diario Oficial del 14 de Febrero de 2018 [source]: http://www.subdere.gov.cl/documentacion/regiones-provincias-y-comunas-de-chile [ref]: http://www.subdere.gov.cl/sites/default/files/documentos/articles-73111_recurso_2.pdf diff --git a/chilean_cities-0.1.1.gem b/chilean_cities-0.1.1.gem new file mode 100644 index 0000000..07392ca Binary files /dev/null and b/chilean_cities-0.1.1.gem differ diff --git a/chilean_cities.gemspec b/chilean_cities.gemspec index bd36d66..96ff14e 100644 --- a/chilean_cities.gemspec +++ b/chilean_cities.gemspec @@ -19,11 +19,11 @@ Gem::Specification.new do |gem| gem.files = Dir["{doc,lib}/**/*", "Gemfile", "LICENSE.txt", "Rakefile", "README.md"] gem.test_files = Dir["spec/**/*"] - gem.add_dependency "activemodel", ">= 3.2.11", "< 5" - gem.add_dependency "rake", "~> 10.4" + gem.add_dependency "activemodel", ">= 3.2.11" + gem.add_dependency "rake" gem.add_dependency "multi_json", "~> 1.0" gem.add_development_dependency "rspec", "~> 3.0" gem.add_development_dependency "inch", "~> 0.4.6" - gem.add_development_dependency "factory_girl", "~> 4.5" + gem.add_development_dependency "factory_bot" end diff --git a/data/comunas.json b/data/comunas.json index 0a1302a..04d64aa 100644 --- a/data/comunas.json +++ b/data/comunas.json @@ -431,7 +431,7 @@ "region_iso_3166_2": "CL-VS" }, { - "name": "Riconada", + "name": "Rinconada", "code": "05303", "provincia": "Los Andes", "region": "Valparaíso", @@ -815,7 +815,7 @@ "region_iso_3166_2": "CL-LI" }, { - "name": "Marichihue", + "name": "Marchihue", "code": "06204", "provincia": "Cardenal Caro", "region": "Región del Libertador Gral. Bernardo O'Higgins", @@ -1422,174 +1422,6 @@ "region_number": "VIII", "region_iso_3166_2": "CL-BI" }, - { - "name": "Chillán", - "code": "08401", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Bulnes", - "code": "08402", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Cobquecura", - "code": "08403", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Coelemu", - "code": "08404", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Coihueco", - "code": "08405", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Chillán Viejo", - "code": "08406", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "El Carmen", - "code": "08407", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Ninhue", - "code": "08408", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Ñiquén", - "code": "08409", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Pemuco", - "code": "08410", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Pinto", - "code": "08411", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Portezuelo", - "code": "08412", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Quillón", - "code": "08413", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Quirihue", - "code": "08414", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Ránquil", - "code": "08415", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "San Carlos", - "code": "08416", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "San Fabián", - "code": "08417", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "San Ignacio", - "code": "08418", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "San Nicolás", - "code": "08419", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Treguaco", - "code": "08420", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, - { - "name": "Yungay", - "code": "08421", - "provincia": "Ñuble", - "region": "Región del Biobío", - "region_number": "VIII", - "region_iso_3166_2": "CL-BI" - }, { "name": "Temuco", "code": "09101", @@ -1599,7 +1431,7 @@ "region_iso_3166_2": "CL-AR" }, { - "name": "Carahu", + "name": "Carahue", "code": "09102", "provincia": "Cautín", "region": "Región de la Araucanía", @@ -1631,7 +1463,7 @@ "region_iso_3166_2": "CL-AR" }, { - "name": "Galvarin", + "name": "Galvarino", "code": "09106", "provincia": "Cautín", "region": "Región de la Araucanía", @@ -1703,7 +1535,7 @@ "region_iso_3166_2": "CL-AR" }, { - "name": "Pucó", + "name": "Pucón", "code": "09115", "provincia": "Cautín", "region": "Región de la Araucanía", @@ -1719,7 +1551,7 @@ "region_iso_3166_2": "CL-AR" }, { - "name": "Teodoro Schmid", + "name": "Teodoro Schmidt", "code": "09117", "provincia": "Cautín", "region": "Región de la Araucanía", @@ -2764,5 +2596,173 @@ "region": "Región Metropolitana de Santiago", "region_number": "XIII", "region_iso_3166_2": "CL-RM" + }, + { + "name": "Chillán", + "code": "16101", + "provincia": "Diguillín", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Bulnes", + "code": "16102", + "provincia": "Diguillín", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Chillán Viejo", + "code": "16103", + "provincia": "Diguillín", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "El Carmen", + "code": "16104", + "provincia": "Diguillín", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Pemuco", + "code": "16105", + "provincia": "Diguillín", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Pinto", + "code": "16106", + "provincia": "Diguillín", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Quillón", + "code": "16107", + "provincia": "Diguillín", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "San Ignacio", + "code": "16108", + "provincia": "Diguillín", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Yungay", + "code": "16109", + "provincia": "Diguillín", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Quirihue", + "code": "16201", + "provincia": "Itata", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Cobquecura", + "code": "16202", + "provincia": "Itata", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Coelemu", + "code": "16203", + "provincia": "Itata", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Ninhue", + "code": "16204", + "provincia": "Itata", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Portezuelo", + "code": "16205", + "provincia": "Itata", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Ránquil", + "code": "16206", + "provincia": "Itata", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Treguaco", + "code": "16207", + "provincia": "Itata", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "San Carlos", + "code": "16301", + "provincia": "Punilla", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Coihueco", + "code": "16302", + "provincia": "Punilla", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "Ñiquén", + "code": "16303", + "provincia": "Punilla", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "San Fabián", + "code": "16304", + "provincia": "Punilla", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" + }, + { + "name": "San Nicolás", + "code": "16305", + "provincia": "Punilla", + "region": "Región de Ñuble", + "region_number": "XVI", + "region_iso_3166_2": "CL-NB" } ] diff --git a/lib/chilean_cities/factory.rb b/lib/chilean_cities/factory.rb index 826b7ae..e33920d 100644 --- a/lib/chilean_cities/factory.rb +++ b/lib/chilean_cities/factory.rb @@ -15,7 +15,7 @@ def generate! @provincias = [] @comunas = [] - data_file = File.read('data/comunas.json') + data_file = File.read(File.dirname(__FILE__) + '/../../data/comunas.json') data = MultiJson.load(data_file, symbolize_keys: true) diff --git a/lib/chilean_cities/version.rb b/lib/chilean_cities/version.rb index 5fedfd1..974ea19 100644 --- a/lib/chilean_cities/version.rb +++ b/lib/chilean_cities/version.rb @@ -1,3 +1,3 @@ module ChileanCities - VERSION = "0.1.0" + VERSION = "0.1.1" end diff --git a/spec/factories/comunas.rb b/spec/factories/comunas.rb index 9373c4c..508c457 100644 --- a/spec/factories/comunas.rb +++ b/spec/factories/comunas.rb @@ -1,10 +1,6 @@ -FactoryGirl.define do +FactoryBot.define do factory :comuna, class: ChileanCities::Comuna do - code 15102 - name 'Camarones' - end - - factory :invalid_comuna, class: ChileanCities::Comuna do - # nop + code { 15102 } + name { 'Camarones' } end end diff --git a/spec/factories/provincias.rb b/spec/factories/provincias.rb index 1504411..893db8d 100644 --- a/spec/factories/provincias.rb +++ b/spec/factories/provincias.rb @@ -1,9 +1,5 @@ -FactoryGirl.define do +FactoryBot.define do factory :provincia, class: ChileanCities::Provincia do - name 'Arica' - end - - factory :invalid_provincia, class: ChileanCities::Provincia do - # nop + name { 'Arica' } end end diff --git a/spec/factories/regiones.rb b/spec/factories/regiones.rb index 1894c6a..6637c9b 100644 --- a/spec/factories/regiones.rb +++ b/spec/factories/regiones.rb @@ -1,10 +1,6 @@ -FactoryGirl.define do +FactoryBot.define do factory :region, class: ChileanCities::Region do - name 'Arica y Parinacota' - iso_3166_2 'CL-AP' - end - - factory :invalid_region, class: ChileanCities::Region do - # nop + name { 'Arica y Parinacota' } + iso_3166_2 { 'CL-AP' } end end diff --git a/spec/lib/chilean_cities/comuna_spec.rb b/spec/lib/chilean_cities/comuna_spec.rb index 7aa44b0..30eb22e 100644 --- a/spec/lib/chilean_cities/comuna_spec.rb +++ b/spec/lib/chilean_cities/comuna_spec.rb @@ -15,15 +15,15 @@ # validations it 'has a valid factory', private: true do - expect(FactoryGirl.build(:comuna)).to be_valid + expect(build(:comuna)).to be_valid end it 'requires a name', private: true do - expect(FactoryGirl.build(:comuna, name: nil)).not_to be_valid + expect(build(:comuna, name: nil)).not_to be_valid end it 'requires a code', private: true do - expect(FactoryGirl.build(:comuna, code: nil)).not_to be_valid + expect(build(:comuna, code: nil)).not_to be_valid end describe '#provincia', data: true, private: true do diff --git a/spec/lib/chilean_cities/factory_spec.rb b/spec/lib/chilean_cities/factory_spec.rb index 32d0f8f..5bf23c0 100644 --- a/spec/lib/chilean_cities/factory_spec.rb +++ b/spec/lib/chilean_cities/factory_spec.rb @@ -15,7 +15,7 @@ describe '#generate!', public: true do it 'generates Comuna, Provincia and Region objects from the data' do - expect(subject.generate!).to eq({ comunas_count: 346, provincias_count: 54, regiones_count: 15 }) + expect(subject.generate!).to eq({ comunas_count: 346, provincias_count: 56, regiones_count: 16 }) end describe 'generates a collection of' do diff --git a/spec/lib/chilean_cities/provincia_spec.rb b/spec/lib/chilean_cities/provincia_spec.rb index fa76aca..0ecec86 100644 --- a/spec/lib/chilean_cities/provincia_spec.rb +++ b/spec/lib/chilean_cities/provincia_spec.rb @@ -13,11 +13,11 @@ # validations it 'has a valid factory', private: true do - expect(FactoryGirl.build(:provincia)).to be_valid + expect(build(:provincia)).to be_valid end it 'requires a name', private: true do - expect(FactoryGirl.build(:provincia, name: nil)).not_to be_valid + expect(build(:provincia, name: nil)).not_to be_valid end describe '#comunas', data: true, private: true do diff --git a/spec/lib/chilean_cities/region_spec.rb b/spec/lib/chilean_cities/region_spec.rb index dc7ae5e..49a59d0 100644 --- a/spec/lib/chilean_cities/region_spec.rb +++ b/spec/lib/chilean_cities/region_spec.rb @@ -15,27 +15,27 @@ # validations it 'has a valid factory', private: true do - expect(FactoryGirl.build(:region)).to be_valid + expect(build(:region)).to be_valid end it 'requires a name', private: true do - expect(FactoryGirl.build(:region, name: nil)).not_to be_valid + expect(build(:region, name: nil)).not_to be_valid end it 'requires an ISO 3166-2:CL code', private: true do # see https://en.wikipedia.org/wiki/ISO_3166-2:CL - expect(FactoryGirl.build(:region, iso_3166_2: nil)).not_to be_valid + expect(build(:region, iso_3166_2: nil)).not_to be_valid end it 'requires iso_3166_2 to be a valid ISO 3166-2:CL code', private: true do - expect(FactoryGirl.build(:region, iso_3166_2: 'CP-AN')).not_to be_valid - expect(FactoryGirl.build(:region, iso_3166_2: 'CL-AND')).not_to be_valid - expect(FactoryGirl.build(:region, iso_3166_2: 'CL_AN')).not_to be_valid - expect(FactoryGirl.build(:region, iso_3166_2: 'CLAN')).not_to be_valid - expect(FactoryGirl.build(:region, iso_3166_2: 'CL-AN')).to be_valid - expect(FactoryGirl.build(:region, iso_3166_2: 'CL-A2')).not_to be_valid - expect(FactoryGirl.build(:region, iso_3166_2: 'ACL-AN')).not_to be_valid - expect(FactoryGirl.build(:region, iso_3166_2: 'AL-AN')).not_to be_valid + expect(build(:region, iso_3166_2: 'CP-AN')).not_to be_valid + expect(build(:region, iso_3166_2: 'CL-AND')).not_to be_valid + expect(build(:region, iso_3166_2: 'CL_AN')).not_to be_valid + expect(build(:region, iso_3166_2: 'CLAN')).not_to be_valid + expect(build(:region, iso_3166_2: 'CL-AN')).to be_valid + expect(build(:region, iso_3166_2: 'CL-A2')).not_to be_valid + expect(build(:region, iso_3166_2: 'ACL-AN')).not_to be_valid + expect(build(:region, iso_3166_2: 'AL-AN')).not_to be_valid end describe '#provincias', data: true, private: true do diff --git a/spec/support/factory_bot.rb b/spec/support/factory_bot.rb new file mode 100644 index 0000000..7a0a6ba --- /dev/null +++ b/spec/support/factory_bot.rb @@ -0,0 +1,7 @@ +require 'factory_bot' + +RSpec.configure do |config| + config.include FactoryBot::Syntax::Methods + + Dir["#{File.dirname(__FILE__)}/../factories/**/*.rb"].each {|f| require f} +end diff --git a/spec/support/factory_girl.rb b/spec/support/factory_girl.rb deleted file mode 100644 index 08b2f52..0000000 --- a/spec/support/factory_girl.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'factory_girl' - -RSpec.configure do |config| - config.include FactoryGirl::Syntax::Methods - - Dir["#{File.dirname(__FILE__)}/../factories/**/*.rb"].each {|f| require f} - - # check_factories_validity! - # see https://github.com/thoughtbot/factory_girl/blob/v4.5.0/GETTING_STARTED.md - # - # factories_to_lint = FactoryGirl.factories.reject do |factory| - # factory.name =~ /^invalid_/ - # end - # - # config.before(:suite) do - # FactoryGirl.lint factories_to_lint - # end -end diff --git a/spec/support/spec_for_list_of_comunas_interface.rb b/spec/support/spec_for_list_of_comunas_interface.rb index 1a68a56..306d735 100644 --- a/spec/support/spec_for_list_of_comunas_interface.rb +++ b/spec/support/spec_for_list_of_comunas_interface.rb @@ -13,7 +13,7 @@ describe '#append_comuna', private: true do it 'appends the comuna to the comunas list if not already present' do - comuna = FactoryGirl.build(:comuna) + comuna = build(:comuna) expect{ comunas_list.append_comuna(comuna) }.to change{ comunas_list.comunas }.from([]).to([comuna]) diff --git a/spec/support/spec_for_list_of_provincias_interface.rb b/spec/support/spec_for_list_of_provincias_interface.rb index bc71759..03e57fd 100644 --- a/spec/support/spec_for_list_of_provincias_interface.rb +++ b/spec/support/spec_for_list_of_provincias_interface.rb @@ -15,7 +15,7 @@ describe '#append_provincia', private: true do it 'appends the provincia to the provincias list if not already present' do - provincia = FactoryGirl.build(:provincia) + provincia = build(:provincia) expect{ provincias_list.append_provincia(provincia) }.to change{ provincias_list.provincias }.from([]).to([provincia])