A Ruby gem to get planning applications data from UK council websites.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

41 行
1.1 KiB

  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