From db2870bd608c3087da62acf6a665cd0f57363e55 Mon Sep 17 00:00:00 2001 From: Aaro Koivukangas Date: Wed, 6 Dec 2023 15:40:31 +0200 Subject: [PATCH] fixed failing places tests --- spec/features/places_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/features/places_spec.rb b/spec/features/places_spec.rb index 8cb4104..88c8b54 100644 --- a/spec/features/places_spec.rb +++ b/spec/features/places_spec.rb @@ -2,6 +2,7 @@ require "rails_helper" describe "Places" do it "displays a place if one is returned from the api" do + allow(Place).to receive(:weather).with("kumpula").and_return nil allow(BeermappingApi).to receive(:places_in).with("kumpula").and_return( [ Place.new( name: "Oljenkorsi", id: 1 ) ] ) @@ -14,6 +15,7 @@ describe "Places" do end it "displays all places if multiple are returned from the api" do + allow(Place).to receive(:weather).with("kumpula").and_return nil allow(BeermappingApi).to receive(:places_in).with("kumpula").and_return( [ Place.new( name: "Oljenkorsi", id: 1 ), Place.new( name: "Emt mitä paikkoja kumpulassa on", id: 2), Place.new( name: ":D", id: 3) ] ) @@ -28,6 +30,7 @@ describe "Places" do end it "displays 'No locations in _city_' if none is returned by the api" do + allow(Place).to receive(:weather).with("kumpula").and_return nil allow(BeermappingApi).to receive(:places_in).with("kumpula").and_return( [] )