mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Update countries and cities spec
This commit is contained in:
parent
89c286a69b
commit
c843ff1577
1 changed files with 26 additions and 16 deletions
|
|
@ -39,18 +39,22 @@ RSpec.describe CountriesAndCities do
|
|||
|
||||
context 'when user stayed in the city for more than 1 hour' do
|
||||
it 'returns countries and cities' do
|
||||
expect(countries_and_cities).to eq(
|
||||
[
|
||||
CountriesAndCities::CountryData.new(
|
||||
country: 'Belgium',
|
||||
cities: [
|
||||
CountriesAndCities::CityData.new(
|
||||
city: 'Kerpen', points: 8, timestamp: 1_609_467_600, stayed_for: 70
|
||||
)
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
expect(countries_and_cities).to match_array([
|
||||
an_object_having_attributes(
|
||||
country: 'Germany',
|
||||
cities: [
|
||||
an_object_having_attributes(
|
||||
city: 'Berlin',
|
||||
points: 8,
|
||||
stayed_for: 70
|
||||
)
|
||||
]
|
||||
),
|
||||
an_object_having_attributes(
|
||||
country: 'Belgium',
|
||||
cities: []
|
||||
)
|
||||
])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -68,10 +72,16 @@ RSpec.describe CountriesAndCities do
|
|||
end
|
||||
|
||||
it 'returns countries and cities' do
|
||||
expect(countries_and_cities).to eq(
|
||||
[
|
||||
]
|
||||
)
|
||||
expect(countries_and_cities).to match_array([
|
||||
an_object_having_attributes(
|
||||
country: 'Germany',
|
||||
cities: []
|
||||
),
|
||||
an_object_having_attributes(
|
||||
country: 'Belgium',
|
||||
cities: []
|
||||
)
|
||||
])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue