A Ruby gem to get planning applications data from UK council websites.
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

43 linhas
937 B

  1. require 'spec_helper'
  2. describe UKPlanningScraper::Authority do
  3. describe '#named' do
  4. let(:authority) { described_class.named(authority_name) }
  5. context 'when authority exists' do
  6. let(:authority_name) { 'Westminster' }
  7. it 'returns an authority' do
  8. expect(authority).to be_a(UKPlanningScraper::Authority)
  9. end
  10. end
  11. context 'when authority does not exist' do
  12. let(:authority_name) { 'Westmonster' }
  13. it 'raises an error' do
  14. expect { authority }.to raise_error(UKPlanningScraper::AuthorityNotFound)
  15. end
  16. end
  17. end
  18. describe '#all' do
  19. let(:all) { described_class.all }
  20. it 'returns all authorities' do
  21. expect(all.count).to eq(48)
  22. end
  23. it 'returns a list of authorities' do
  24. all.each do |authority|
  25. expect(authority).to be_a(UKPlanningScraper::Authority)
  26. end
  27. end
  28. end
  29. end