Skip to content

Instantly share code, notes, and snippets.

@IvikGH
Created April 13, 2018 12:04
Show Gist options
  • Save IvikGH/d9546eaacd7a9876d0fdc12a37f8eb13 to your computer and use it in GitHub Desktop.
Save IvikGH/d9546eaacd7a9876d0fdc12a37f8eb13 to your computer and use it in GitHub Desktop.
let(:inst_client) { double(user: inst_user) }
let(:inst_user) do
# instance_double(Instagram::Client, id: instagram_id,
double(id: instagram_id,
access_token: access_token,
username: name,
full_name: 'John Doe',
picture: picture)
end
before do
user.update(instagram_id: instagram_id)
# allow(Instagram::Client).to receive(:user).and_return(inst_user)
end
context 'when user found by Instagram id' do
it 'returns user object' do
allow(Instagram).to receive(:client).and_return(inst_user)
# double(Instagram::Client, client: inst_client)
# allow(Instagram::Client).to receive(:user).and_return(inst_user)
# byebug
expect(subject).to eq(user)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment