@ -154,7 +154,6 @@ RSpec.describe Location, type: :model do
" E09000001 " = > " City of London " ,
" E09000001 " = > " City of London " ,
" E07000071 " = > " Colchester " ,
" E07000071 " = > " Colchester " ,
" E07000029 " = > " Copeland " ,
" E07000029 " = > " Copeland " ,
" E07000150 " = > " Corby " ,
" E06000052 " = > " Cornwall " ,
" E06000052 " = > " Cornwall " ,
" E07000079 " = > " Cotswold " ,
" E07000079 " = > " Cotswold " ,
" E06000047 " = > " County Durham " ,
" E06000047 " = > " County Durham " ,
@ -165,7 +164,6 @@ RSpec.describe Location, type: :model do
" E07000096 " = > " Dacorum " ,
" E07000096 " = > " Dacorum " ,
" E06000005 " = > " Darlington " ,
" E06000005 " = > " Darlington " ,
" E07000107 " = > " Dartford " ,
" E07000107 " = > " Dartford " ,
" E07000151 " = > " Daventry " ,
" E06000015 " = > " Derby " ,
" E06000015 " = > " Derby " ,
" E07000035 " = > " Derbyshire Dales " ,
" E07000035 " = > " Derbyshire Dales " ,
" E08000017 " = > " Doncaster " ,
" E08000017 " = > " Doncaster " ,
@ -178,7 +176,6 @@ RSpec.describe Location, type: :model do
" E07000085 " = > " East Hampshire " ,
" E07000085 " = > " East Hampshire " ,
" E07000242 " = > " East Hertfordshire " ,
" E07000242 " = > " East Hertfordshire " ,
" E07000137 " = > " East Lindsey " ,
" E07000137 " = > " East Lindsey " ,
" E07000152 " = > " East Northamptonshire " ,
" E06000011 " = > " East Riding of Yorkshire " ,
" E06000011 " = > " East Riding of Yorkshire " ,
" E07000193 " = > " East Staffordshire " ,
" E07000193 " = > " East Staffordshire " ,
" E07000244 " = > " East Suffolk " ,
" E07000244 " = > " East Suffolk " ,
@ -232,7 +229,6 @@ RSpec.describe Location, type: :model do
" E06000053 " = > " Isles of Scilly " ,
" E06000053 " = > " Isles of Scilly " ,
" E09000019 " = > " Islington " ,
" E09000019 " = > " Islington " ,
" E09000020 " = > " Kensington and Chelsea " ,
" E09000020 " = > " Kensington and Chelsea " ,
" E07000153 " = > " Kettering " ,
" E07000146 " = > " King’s Lynn and West Norfolk " ,
" E07000146 " = > " King’s Lynn and West Norfolk " ,
" E06000010 " = > " Kingston upon Hull, City of " ,
" E06000010 " = > " Kingston upon Hull, City of " ,
" E09000021 " = > " Kingston upon Thames " ,
" E09000021 " = > " Kingston upon Thames " ,
@ -275,11 +271,11 @@ RSpec.describe Location, type: :model do
" E07000139 " = > " North Kesteven " ,
" E07000139 " = > " North Kesteven " ,
" E06000013 " = > " North Lincolnshire " ,
" E06000013 " = > " North Lincolnshire " ,
" E07000147 " = > " North Norfolk " ,
" E07000147 " = > " North Norfolk " ,
" E06000061 " = > " North Northamptonshire " ,
" E06000024 " = > " North Somerset " ,
" E06000024 " = > " North Somerset " ,
" E08000022 " = > " North Tyneside " ,
" E08000022 " = > " North Tyneside " ,
" E07000218 " = > " North Warwickshire " ,
" E07000218 " = > " North Warwickshire " ,
" E07000134 " = > " North West Leicestershire " ,
" E07000134 " = > " North West Leicestershire " ,
" E07000154 " = > " Northampton " ,
" E06000057 " = > " Northumberland " ,
" E06000057 " = > " Northumberland " ,
" E07000148 " = > " Norwich " ,
" E07000148 " = > " Norwich " ,
" E06000018 " = > " Nottingham " ,
" E06000018 " = > " Nottingham " ,
@ -331,7 +327,6 @@ RSpec.describe Location, type: :model do
" E07000141 " = > " South Kesteven " ,
" E07000141 " = > " South Kesteven " ,
" E07000031 " = > " South Lakeland " ,
" E07000031 " = > " South Lakeland " ,
" E07000149 " = > " South Norfolk " ,
" E07000149 " = > " South Norfolk " ,
" E07000155 " = > " South Northamptonshire " ,
" E07000179 " = > " South Oxfordshire " ,
" E07000179 " = > " South Oxfordshire " ,
" E07000126 " = > " South Ribble " ,
" E07000126 " = > " South Ribble " ,
" E07000189 " = > " South Somerset " ,
" E07000189 " = > " South Somerset " ,
@ -384,12 +379,12 @@ RSpec.describe Location, type: :model do
" E07000103 " = > " Watford " ,
" E07000103 " = > " Watford " ,
" E07000216 " = > " Waverley " ,
" E07000216 " = > " Waverley " ,
" E07000065 " = > " Wealden " ,
" E07000065 " = > " Wealden " ,
" E07000156 " = > " Wellingborough " ,
" E07000241 " = > " Welwyn Hatfield " ,
" E07000241 " = > " Welwyn Hatfield " ,
" E06000037 " = > " West Berkshire " ,
" E06000037 " = > " West Berkshire " ,
" E07000047 " = > " West Devon " ,
" E07000047 " = > " West Devon " ,
" E07000127 " = > " West Lancashire " ,
" E07000127 " = > " West Lancashire " ,
" E07000142 " = > " West Lindsey " ,
" E07000142 " = > " West Lindsey " ,
" E06000062 " = > " West Northamptonshire " ,
" E07000181 " = > " West Oxfordshire " ,
" E07000181 " = > " West Oxfordshire " ,
" E07000245 " = > " West Suffolk " ,
" E07000245 " = > " West Suffolk " ,
" E09000033 " = > " Westminster " ,
" E09000033 " = > " Westminster " ,
@ -481,7 +476,6 @@ RSpec.describe Location, type: :model do
" E07000118 " = > " Chorley " ,
" E07000118 " = > " Chorley " ,
" E09000001 " = > " City of London " ,
" E09000001 " = > " City of London " ,
" E07000071 " = > " Colchester " ,
" E07000071 " = > " Colchester " ,
" E07000150 " = > " Corby " ,
" E06000052 " = > " Cornwall " ,
" E06000052 " = > " Cornwall " ,
" E07000079 " = > " Cotswold " ,
" E07000079 " = > " Cotswold " ,
" E06000047 " = > " County Durham " ,
" E06000047 " = > " County Durham " ,
@ -492,7 +486,6 @@ RSpec.describe Location, type: :model do
" E07000096 " = > " Dacorum " ,
" E07000096 " = > " Dacorum " ,
" E06000005 " = > " Darlington " ,
" E06000005 " = > " Darlington " ,
" E07000107 " = > " Dartford " ,
" E07000107 " = > " Dartford " ,
" E07000151 " = > " Daventry " ,
" E06000015 " = > " Derby " ,
" E06000015 " = > " Derby " ,
" E07000035 " = > " Derbyshire Dales " ,
" E07000035 " = > " Derbyshire Dales " ,
" E08000017 " = > " Doncaster " ,
" E08000017 " = > " Doncaster " ,
@ -505,7 +498,6 @@ RSpec.describe Location, type: :model do
" E07000085 " = > " East Hampshire " ,
" E07000085 " = > " East Hampshire " ,
" E07000242 " = > " East Hertfordshire " ,
" E07000242 " = > " East Hertfordshire " ,
" E07000137 " = > " East Lindsey " ,
" E07000137 " = > " East Lindsey " ,
" E07000152 " = > " East Northamptonshire " ,
" E06000011 " = > " East Riding of Yorkshire " ,
" E06000011 " = > " East Riding of Yorkshire " ,
" E07000193 " = > " East Staffordshire " ,
" E07000193 " = > " East Staffordshire " ,
" E07000244 " = > " East Suffolk " ,
" E07000244 " = > " East Suffolk " ,
@ -556,7 +548,6 @@ RSpec.describe Location, type: :model do
" E06000053 " = > " Isles of Scilly " ,
" E06000053 " = > " Isles of Scilly " ,
" E09000019 " = > " Islington " ,
" E09000019 " = > " Islington " ,
" E09000020 " = > " Kensington and Chelsea " ,
" E09000020 " = > " Kensington and Chelsea " ,
" E07000153 " = > " Kettering " ,
" E07000146 " = > " King’s Lynn and West Norfolk " ,
" E07000146 " = > " King’s Lynn and West Norfolk " ,
" E06000010 " = > " Kingston upon Hull, City of " ,
" E06000010 " = > " Kingston upon Hull, City of " ,
" E09000021 " = > " Kingston upon Thames " ,
" E09000021 " = > " Kingston upon Thames " ,
@ -598,12 +589,12 @@ RSpec.describe Location, type: :model do
" E07000139 " = > " North Kesteven " ,
" E07000139 " = > " North Kesteven " ,
" E06000013 " = > " North Lincolnshire " ,
" E06000013 " = > " North Lincolnshire " ,
" E07000147 " = > " North Norfolk " ,
" E07000147 " = > " North Norfolk " ,
" E06000061 " = > " North Northamptonshire " ,
" E06000024 " = > " North Somerset " ,
" E06000024 " = > " North Somerset " ,
" E08000022 " = > " North Tyneside " ,
" E08000022 " = > " North Tyneside " ,
" E07000218 " = > " North Warwickshire " ,
" E07000218 " = > " North Warwickshire " ,
" E07000134 " = > " North West Leicestershire " ,
" E07000134 " = > " North West Leicestershire " ,
" E06000065 " = > " North Yorkshire " ,
" E06000065 " = > " North Yorkshire " ,
" E07000154 " = > " Northampton " ,
" E06000057 " = > " Northumberland " ,
" E06000057 " = > " Northumberland " ,
" E07000148 " = > " Norwich " ,
" E07000148 " = > " Norwich " ,
" E06000018 " = > " Nottingham " ,
" E06000018 " = > " Nottingham " ,
@ -649,7 +640,6 @@ RSpec.describe Location, type: :model do
" E07000140 " = > " South Holland " ,
" E07000140 " = > " South Holland " ,
" E07000141 " = > " South Kesteven " ,
" E07000141 " = > " South Kesteven " ,
" E07000149 " = > " South Norfolk " ,
" E07000149 " = > " South Norfolk " ,
" E07000155 " = > " South Northamptonshire " ,
" E07000179 " = > " South Oxfordshire " ,
" E07000179 " = > " South Oxfordshire " ,
" E07000126 " = > " South Ribble " ,
" E07000126 " = > " South Ribble " ,
" E07000196 " = > " South Staffordshire " ,
" E07000196 " = > " South Staffordshire " ,
@ -701,12 +691,12 @@ RSpec.describe Location, type: :model do
" E07000103 " = > " Watford " ,
" E07000103 " = > " Watford " ,
" E07000216 " = > " Waverley " ,
" E07000216 " = > " Waverley " ,
" E07000065 " = > " Wealden " ,
" E07000065 " = > " Wealden " ,
" E07000156 " = > " Wellingborough " ,
" E07000241 " = > " Welwyn Hatfield " ,
" E07000241 " = > " Welwyn Hatfield " ,
" E06000037 " = > " West Berkshire " ,
" E06000037 " = > " West Berkshire " ,
" E07000047 " = > " West Devon " ,
" E07000047 " = > " West Devon " ,
" E07000127 " = > " West Lancashire " ,
" E07000127 " = > " West Lancashire " ,
" E07000142 " = > " West Lindsey " ,
" E07000142 " = > " West Lindsey " ,
" E06000062 " = > " West Northamptonshire " ,
" E07000181 " = > " West Oxfordshire " ,
" E07000181 " = > " West Oxfordshire " ,
" E07000245 " = > " West Suffolk " ,
" E07000245 " = > " West Suffolk " ,
" E09000033 " = > " Westminster " ,
" E09000033 " = > " Westminster " ,
@ -953,8 +943,8 @@ RSpec.describe Location, type: :model do
context " and the location was created at the start of the 2022/23 collection window " do
context " and the location was created at the start of the 2022/23 collection window " do
let ( :location ) { FactoryBot . build ( :location , created_at : Time . zone . local ( 2022 , 4 , 6 ) , startdate : nil ) }
let ( :location ) { FactoryBot . build ( :location , created_at : Time . zone . local ( 2022 , 4 , 6 ) , startdate : nil ) }
it " returns the beginning of 22/23 collection window " do
it " returns the beginning of 21/22 collection window " do
expect ( location . available_from ) . to eq ( Time . zone . local ( 2022 , 4 , 1 ) )
expect ( location . available_from ) . to eq ( Time . zone . local ( 2021 , 4 , 1 ) )
end
end
end
end
@ -969,16 +959,16 @@ RSpec.describe Location, type: :model do
context " and the location was created at the start of the 2021/22 collection window " do
context " and the location was created at the start of the 2021/22 collection window " do
let ( :location ) { FactoryBot . build ( :location , created_at : Time . zone . local ( 2021 , 4 , 6 ) , startdate : nil ) }
let ( :location ) { FactoryBot . build ( :location , created_at : Time . zone . local ( 2021 , 4 , 6 ) , startdate : nil ) }
it " returns the beginning of 21/22 collection window " do
it " returns the beginning of 20/21 collection window " do
expect ( location . available_from ) . to eq ( Time . zone . local ( 2021 , 4 , 1 ) )
expect ( location . available_from ) . to eq ( Time . zone . local ( 2020 , 4 , 1 ) )
end
end
end
end
context " and the location was created at the end of the 2021/22 collection window " do
context " and the location was created at the end of the 2021/22 collection window " do
let ( :location ) { FactoryBot . build ( :location , created_at : Time . zone . local ( 2022 , 2 , 6 ) , startdate : nil ) }
let ( :location ) { FactoryBot . build ( :location , created_at : Time . zone . local ( 2022 , 2 , 6 ) , startdate : nil ) }
it " returns the beginning of 21/22 collection window " do
it " returns the beginning of 20/21 collection window " do
expect ( location . available_from ) . to eq ( Time . zone . local ( 2021 , 4 , 1 ) )
expect ( location . available_from ) . to eq ( Time . zone . local ( 2020 , 4 , 1 ) )
end
end
end
end
end
end