mercredi 28 août 2019

Expect "Object" to receive message not working as expected

I have this spec:

it 'makes a request to google if redis is empty' do
  fetch_cfm_data

  expect(GoogleCalendarApi::V1::Client).to receive(:get_cfm)
end

I've debugged the messages being called during this process of my test and GoogleCalendarApi::V1::Client.get_cfm is certainly being called because I can pry inside of that method during the test run. Why does my test return this failure? -

Failure/Error: expect(GoogleCalendarApi::V1::Client).to receive(:get_cfm)

       (GoogleCalendarApi::V1::Client (class)).get_cfm(*(any args))
           expected: 1 time with any arguments
           received: 0 times with any arguments

Aucun commentaire:

Enregistrer un commentaire