Skip to content

Commit

Permalink
improved directions unit spec (+)
Browse files Browse the repository at this point in the history
- spec for wrong latitude value
- spec for wrong longitude value
  • Loading branch information
alexmik95 committed Oct 21, 2019
1 parent fd98998 commit d91ae33
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/unit/directions_spec.rb
Expand Up @@ -61,6 +61,26 @@
end
end

context 'when wrong latitude is passed' do
let(:params) { { origin: '0.0,0.0', destination: '91.0,0.0'} }

it 'raises ArgumentError' do
expect { subject }.to raise_error(
ArgumentError, 'Wrong latitude value'
)
end
end

context 'when wrong longitude is passed' do
let(:params) { { origin: '0.0,0.0', destination: '0.0,181.0'} }

it 'raises ArgumentError' do
expect { subject }.to raise_error(
ArgumentError, 'Wrong longitude value'
)
end
end

context 'when no argument passed' do
let(:params) { {} }

Expand Down

0 comments on commit d91ae33

Please sign in to comment.