mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Add spec for MINIMUM_POINTS_IN_CITY = 3
This commit is contained in:
parent
0afea82aae
commit
904fdaf8be
1 changed files with 26 additions and 9 deletions
|
|
@ -14,17 +14,34 @@ RSpec.describe CountriesAndCities do
|
|||
]
|
||||
end
|
||||
|
||||
before do
|
||||
stub_const('CountriesAndCities::MINIMUM_POINTS_IN_CITY', 1)
|
||||
context 'when MINIMUM_POINTS_IN_CITY is 1' do
|
||||
before do
|
||||
stub_const('CountriesAndCities::MINIMUM_POINTS_IN_CITY', 1)
|
||||
end
|
||||
|
||||
it 'returns countries and cities' do
|
||||
expect(countries_and_cities).to eq(
|
||||
[
|
||||
{ cities: [{city: "City", points: 3, timestamp: 1}], country: "Country" },
|
||||
{ cities: [{city: "Another city", points: 2, timestamp: 1}], country: "Some Country" }
|
||||
]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
it 'returns countries and cities' do
|
||||
expect(countries_and_cities).to eq(
|
||||
[
|
||||
{ cities: [{city: "City", points: 3, timestamp: 1}], country: "Country" },
|
||||
{ cities: [{city: "Another city", points: 2, timestamp: 1}], country: "Some Country" }
|
||||
]
|
||||
)
|
||||
context 'when MINIMUM_POINTS_IN_CITY is 3' do
|
||||
before do
|
||||
stub_const('CountriesAndCities::MINIMUM_POINTS_IN_CITY', 3)
|
||||
end
|
||||
|
||||
it 'returns countries and cities' do
|
||||
expect(countries_and_cities).to eq(
|
||||
[
|
||||
{ cities: [{city: "City", points: 3, timestamp: 1}], country: "Country" },
|
||||
{ cities: [], country: "Some Country" }
|
||||
]
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue