spec/spacex/ships_spec.rb in spacex-0.0.7 vs spec/spacex/ships_spec.rb in spacex-1.0.0
- old
+ new
@@ -1,9 +1,9 @@
require 'spec_helper'
-describe SPACEX do
- context 'Ships', vcr: { cassette_name: 'ships/info' } do
+describe SPACEX::Ships do
+ context '#info', vcr: { cassette_name: 'ships/info' } do
subject do
SPACEX::Ships.info
end
it 'returns Ships info' do
expect(subject.first.ship_id).to eq 'AMERICANCHAMPION'
@@ -21,19 +21,19 @@
expect(subject.first.year_built).to eq 1976
expect(subject.first.home_port).to eq 'Port of Los Angeles'
expect(subject.first.status).to eq 'Stopped'
expect(subject.first.speed_kn).to eq 0
expect(subject.first.course_deg).to eq nil
- expect(subject.first.position).to eq ({ 'latitude' => 30.52852, 'longitude' => -88.09869 })
+ expect(subject.first.position).to eq ({ 'latitude' => 30.5276, 'longitude' => -88.10261 })
expect(subject.first.successful_landings).to eq nil
expect(subject.first.attempted_landings).to eq nil
expect(subject.first.missions).to eq [{ 'flight' => 7, 'name' => 'COTS 1' }, { 'flight' => 8, 'name' => 'COTS 2' }]
expect(subject.first.url).to eq 'https://www.marinetraffic.com/en/ais/details/ships/shipid:434663/vessel:AMERICAN%20CHAMPION'
expect(subject.first.image).to eq 'https://i.imgur.com/woCxpkj.jpg'
end
end
- context 'Get specific Ship', vcr: { cassette_name: 'ships/info/AMERICANCHAMPION' } do
+ context "#info('AMERICANCHAMPION')", vcr: { cassette_name: 'ships/info/AMERICANCHAMPION' } do
subject do
SPACEX::Ships.info('AMERICANCHAMPION')
end
it 'returns Ship info for "AMERICANCHAMPION"' do
expect(subject.ship_id).to eq 'AMERICANCHAMPION'