I have a confusion about how to mock a class method using new expect
syntax. This works:
Facebook .should_receive(:profile) .with("token") .and_return({"name" => "Hello", "id" => "14314141", "email" => "hello@me.com"})
and this doesn't:
facebook = double("Facebook") allow(facebook).to receive(:profile).with("token").and_return({"name" => "Hello", "id" => "14314141", "email" => "hello@me.com"})
Can someone tell me what is wrong here?