Skip to content

Instantly share code, notes, and snippets.

@IvikGH
Created April 13, 2018 11:34
Show Gist options
  • Save IvikGH/450eb7f45811962d2d23aa1bda25fdd1 to your computer and use it in GitHub Desktop.
Save IvikGH/450eb7f45811962d2d23aa1bda25fdd1 to your computer and use it in GitHub Desktop.
inst
let(:instagram_id) { '1234567890' }
let(:picture) { 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png' }
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
double(Instagram::Client, client: inst_client)
# 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