Created
December 3, 2013 05:09
-
-
Save zaneclaes/7764156 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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