spec/view_spec.rb in censu-0.1.4 vs spec/view_spec.rb in censu-0.1.5

- old
+ new

@@ -10,16 +10,19 @@ it "should return IPv4 response" do view = @api.view(:ipv4, "8.8.8.8") expect(view).to be_a(Censys::IPv4) expect(view.tags).to be_a(Array) expect(view.updated_at).to be_a(Time) + expect(view.autonomous_system).to be_a(AutonomousSystem) + expect(view.autonomous_system.routed_prefix).to eq("8.8.8.0/24") + expect(view.location).to be_a(Location) + expect(view.location.city).to eq("Mountain View") + expect(view.ports).to be_a(Hash) expect(view.protocols).to be_a(Array) - expect(view["location.city"]).to eq("Mountain View") - expect(view.dig("location", "city")).to eq("Mountain View") expect(view.ip).to eq("8.8.8.8") expect(view.to_s).to eq("8.8.8.8") expect(view.protocols).to be_a(Array) end @@ -31,16 +34,16 @@ expect(view).to be_a(Censys::Website) expect(view.domain).to eq("google.com") expect(view.to_s).to eq("google.com") expect(view.alexa_rank).to be_a(Integer) - expect(view["80.http.get.body"]).to be_a(String) - expect(view.http_response).to be_a(Censys::HTTPResponse) expect(view.http_response.body).to be_a(String) expect(view.http_response.header).to be_a(Hash) expect(view.http_response.status_code).to eq(200) expect(view.http_response.title).to eq("Google") + + expect(view["80.http.get.body"]).to be_a(String) end end context "certificates" do it "should return Certificate response" do