A Ruby gem to get planning applications data from UK council websites.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

council_reference_spec.rb 1.1 KiB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. require 'spec_helper'
  2. describe UKPlanningScraper::Authority do
  3. describe 'named+council_reference scrape' do
  4. let(:scraper) { UKPlanningScraper::Authority.named(authority_name).council_reference(council_reference) }
  5. context 'for an existing idox planning reference' do
  6. let(:authority_name) { 'Brighton and Hove' }
  7. let(:council_reference) { 'BH2017/04225' }
  8. subject(:apps) {
  9. VCR.use_cassette("#{self.class.description}") {
  10. scraper.scrape
  11. }
  12. }
  13. it 'returns an app (in the apps array)' do
  14. expect(apps.any?).to be_truthy
  15. end
  16. it 'has a status of Withdrawn' do
  17. expect(apps.first[:status]).to eql('Withdrawn')
  18. end
  19. end
  20. context 'for a non-existant idox planning reference' do
  21. let(:authority_name) { 'Brighton and Hove' }
  22. let(:council_reference) { 'XYZ123' }
  23. subject(:apps) {
  24. VCR.use_cassette("#{self.class.description}") {
  25. scraper.scrape
  26. }
  27. }
  28. it 'returns an empty apps array' do
  29. expect(apps.empty?).to be_truthy
  30. end
  31. end
  32. end
  33. end