Skip to content

Instantly share code, notes, and snippets.

@zaneclaes
Created December 3, 2013 05:09
Show Gist options
  • Save zaneclaes/7764156 to your computer and use it in GitHub Desktop.
Save zaneclaes/7764156 to your computer and use it in GitHub Desktop.
describe "#social_connections" do
before do
# Social connections are cached within the model. To prevent cross-talk
# between the tests, make sure to clear out Rails' cache.
Rails.cache.clear
@target_user = FactoryGirl.create(:user)
@current_user = FactoryGirl.create(:user)
FactoryGirl.create(:relationship, :user => @current_user, :friend => @target_user)
end
context 'when logged in as a random user' do
it 'lists social connections' do
get :social_connections, @target_user.id, api_logged_in_as_user($current_user)
response_json['connections'].keys.should =~ user_json_keys
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment