mirror of
https://github.com/iritmaximus/brewery.git
synced 2026-10-12 19:13:49 +03:00
fixed failing places tests
This commit is contained in:
@@ -2,6 +2,7 @@ require "rails_helper"
|
|||||||
|
|
||||||
describe "Places" do
|
describe "Places" do
|
||||||
it "displays a place if one is returned from the api" 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(
|
allow(BeermappingApi).to receive(:places_in).with("kumpula").and_return(
|
||||||
[ Place.new( name: "Oljenkorsi", id: 1 ) ]
|
[ Place.new( name: "Oljenkorsi", id: 1 ) ]
|
||||||
)
|
)
|
||||||
@@ -14,6 +15,7 @@ describe "Places" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "displays all places if multiple are returned from the api" do
|
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(
|
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) ]
|
[ 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
|
end
|
||||||
|
|
||||||
it "displays 'No locations in _city_' if none is returned by the api" do
|
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(
|
allow(BeermappingApi).to receive(:places_in).with("kumpula").and_return(
|
||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user