Created
December 3, 2013 06:27
-
-
Save zaneclaes/7764759 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 :each do | |
@target_user = FactoryGirl.create(:user) | |
@target_user_listing = FactoryGirl.create(:listing, :user => @target_user) | |
@current_user = FactoryGirl.create(:user) | |
@relationship = FactoryGirl.create(:relationship, :user => @current_user, :friend => @target_user) | |
@params = {:id => @target_user.id, :api_version => 'v1'} | |
end | |
context 'when logged in as a befriended user' do | |
it 'lists social connections' do | |
get :social_connections, api_logged_in_as_user(@params, @current_user) | |
pp response_json #prints {"connections_count"=>0, "connections"=>[]} | |
pp @target_user.id #prints 143875 | |
pp @current_user.id #prints 143876 | |
pp @relationship #prints <Relationship id: 1, user_id: 143876, friend_id: 143875, relationship_type: 1, status: 1, privacy_setting: nil, created_at: "2013-12-03 06:04:00", updated_at: "2013-12-03 06:04:00"> | |
response_json['connections_count'].should > 0 | |
response_json['connections'][0].keys.should =~ user_basic_keys | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment