tenderlove-facebooker 1.0.16.20090319151701

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. data/CHANGELOG.rdoc +17 -0
  2. data/COPYING.rdoc +19 -0
  3. data/Manifest.txt +123 -0
  4. data/README.rdoc +103 -0
  5. data/Rakefile +86 -0
  6. data/TODO.rdoc +4 -0
  7. data/examples/desktop_login.rb +14 -0
  8. data/facebooker.gemspec +38 -0
  9. data/generators/facebook/facebook_generator.rb +14 -0
  10. data/generators/facebook/templates/config/facebooker.yml +46 -0
  11. data/generators/facebook/templates/public/javascripts/facebooker.js +99 -0
  12. data/generators/facebook_controller/USAGE +33 -0
  13. data/generators/facebook_controller/facebook_controller_generator.rb +40 -0
  14. data/generators/facebook_controller/templates/controller.rb +7 -0
  15. data/generators/facebook_controller/templates/functional_test.rb +11 -0
  16. data/generators/facebook_controller/templates/helper.rb +2 -0
  17. data/generators/facebook_controller/templates/view.fbml.erb +2 -0
  18. data/generators/facebook_controller/templates/view.html.erb +2 -0
  19. data/generators/facebook_publisher/facebook_publisher_generator.rb +14 -0
  20. data/generators/facebook_publisher/templates/create_facebook_templates.rb +15 -0
  21. data/generators/facebook_publisher/templates/publisher.rb +3 -0
  22. data/generators/facebook_scaffold/USAGE +27 -0
  23. data/generators/facebook_scaffold/facebook_scaffold_generator.rb +118 -0
  24. data/generators/facebook_scaffold/templates/controller.rb +93 -0
  25. data/generators/facebook_scaffold/templates/facebook_style.css +2579 -0
  26. data/generators/facebook_scaffold/templates/functional_test.rb +89 -0
  27. data/generators/facebook_scaffold/templates/helper.rb +2 -0
  28. data/generators/facebook_scaffold/templates/layout.fbml.erb +6 -0
  29. data/generators/facebook_scaffold/templates/layout.html.erb +17 -0
  30. data/generators/facebook_scaffold/templates/style.css +74 -0
  31. data/generators/facebook_scaffold/templates/view_edit.fbml.erb +13 -0
  32. data/generators/facebook_scaffold/templates/view_edit.html.erb +18 -0
  33. data/generators/facebook_scaffold/templates/view_index.fbml.erb +24 -0
  34. data/generators/facebook_scaffold/templates/view_index.html.erb +24 -0
  35. data/generators/facebook_scaffold/templates/view_new.fbml.erb +12 -0
  36. data/generators/facebook_scaffold/templates/view_new.html.erb +17 -0
  37. data/generators/facebook_scaffold/templates/view_show.fbml.erb +10 -0
  38. data/generators/facebook_scaffold/templates/view_show.html.erb +10 -0
  39. data/generators/publisher/publisher_generator.rb +14 -0
  40. data/generators/xd_receiver/templates/xd_receiver.html +10 -0
  41. data/generators/xd_receiver/xd_receiver_generator.rb +9 -0
  42. data/init.rb +72 -0
  43. data/install.rb +12 -0
  44. data/lib/facebooker/adapters/adapter_base.rb +87 -0
  45. data/lib/facebooker/adapters/bebo_adapter.rb +75 -0
  46. data/lib/facebooker/adapters/facebook_adapter.rb +52 -0
  47. data/lib/facebooker/admin.rb +42 -0
  48. data/lib/facebooker/batch_request.rb +44 -0
  49. data/lib/facebooker/data.rb +57 -0
  50. data/lib/facebooker/feed.rb +78 -0
  51. data/lib/facebooker/logging.rb +51 -0
  52. data/lib/facebooker/mobile.rb +20 -0
  53. data/lib/facebooker/mock/service.rb +50 -0
  54. data/lib/facebooker/mock/session.rb +18 -0
  55. data/lib/facebooker/model.rb +135 -0
  56. data/lib/facebooker/models/affiliation.rb +10 -0
  57. data/lib/facebooker/models/album.rb +11 -0
  58. data/lib/facebooker/models/applicationproperties.rb +39 -0
  59. data/lib/facebooker/models/applicationrestrictions.rb +10 -0
  60. data/lib/facebooker/models/cookie.rb +10 -0
  61. data/lib/facebooker/models/education_info.rb +11 -0
  62. data/lib/facebooker/models/event.rb +28 -0
  63. data/lib/facebooker/models/friend_list.rb +16 -0
  64. data/lib/facebooker/models/group.rb +36 -0
  65. data/lib/facebooker/models/info_item.rb +10 -0
  66. data/lib/facebooker/models/info_section.rb +10 -0
  67. data/lib/facebooker/models/location.rb +8 -0
  68. data/lib/facebooker/models/notifications.rb +17 -0
  69. data/lib/facebooker/models/page.rb +27 -0
  70. data/lib/facebooker/models/photo.rb +12 -0
  71. data/lib/facebooker/models/tag.rb +12 -0
  72. data/lib/facebooker/models/user.rb +426 -0
  73. data/lib/facebooker/models/video.rb +9 -0
  74. data/lib/facebooker/models/work_info.rb +9 -0
  75. data/lib/facebooker/parser.rb +589 -0
  76. data/lib/facebooker/rails/controller.rb +304 -0
  77. data/lib/facebooker/rails/cucumber/world.rb +46 -0
  78. data/lib/facebooker/rails/cucumber.rb +28 -0
  79. data/lib/facebooker/rails/facebook_form_builder.rb +112 -0
  80. data/lib/facebooker/rails/facebook_pretty_errors.rb +22 -0
  81. data/lib/facebooker/rails/facebook_request_fix.rb +24 -0
  82. data/lib/facebooker/rails/facebook_session_handling.rb +69 -0
  83. data/lib/facebooker/rails/facebook_url_helper.rb +192 -0
  84. data/lib/facebooker/rails/facebook_url_rewriting.rb +39 -0
  85. data/lib/facebooker/rails/helpers/fb_connect.rb +89 -0
  86. data/lib/facebooker/rails/helpers.rb +762 -0
  87. data/lib/facebooker/rails/integration_session.rb +38 -0
  88. data/lib/facebooker/rails/profile_publisher_extensions.rb +42 -0
  89. data/lib/facebooker/rails/publisher.rb +526 -0
  90. data/lib/facebooker/rails/routing.rb +49 -0
  91. data/lib/facebooker/rails/test_helpers.rb +68 -0
  92. data/lib/facebooker/rails/utilities.rb +22 -0
  93. data/lib/facebooker/server_cache.rb +24 -0
  94. data/lib/facebooker/service.rb +94 -0
  95. data/lib/facebooker/session.rb +584 -0
  96. data/lib/facebooker/version.rb +9 -0
  97. data/lib/facebooker.rb +174 -0
  98. data/lib/net/http_multipart_post.rb +123 -0
  99. data/lib/tasks/facebooker.rake +18 -0
  100. data/lib/tasks/tunnel.rake +46 -0
  101. data/rails/init.rb +1 -0
  102. data/setup.rb +1585 -0
  103. data/templates/layout.erb +24 -0
  104. data/test/facebooker/adapters_test.rb +96 -0
  105. data/test/facebooker/admin_test.rb +102 -0
  106. data/test/facebooker/batch_request_test.rb +83 -0
  107. data/test/facebooker/data_test.rb +86 -0
  108. data/test/facebooker/logging_test.rb +43 -0
  109. data/test/facebooker/mobile_test.rb +45 -0
  110. data/test/facebooker/model_test.rb +123 -0
  111. data/test/facebooker/models/event_test.rb +15 -0
  112. data/test/facebooker/models/user_test.rb +295 -0
  113. data/test/facebooker/rails/publisher_test.rb +452 -0
  114. data/test/facebooker/rails_integration_test.rb +1312 -0
  115. data/test/facebooker/server_cache_test.rb +44 -0
  116. data/test/facebooker/session_test.rb +614 -0
  117. data/test/facebooker_test.rb +925 -0
  118. data/test/fixtures/multipart_post_body_with_only_parameters.txt +33 -0
  119. data/test/fixtures/multipart_post_body_with_single_file.txt +38 -0
  120. data/test/fixtures/multipart_post_body_with_single_file_that_has_nil_key.txt +38 -0
  121. data/test/net/http_multipart_post_test.rb +52 -0
  122. data/test/rails_test_helper.rb +11 -0
  123. data/test/test_helper.rb +66 -0
  124. metadata +217 -0
@@ -0,0 +1,295 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
2
+ require 'active_support'
3
+
4
+ class Facebooker::UserTest < Test::Unit::TestCase
5
+
6
+ def setup
7
+ @session = Facebooker::Session.create('apikey', 'secretkey')
8
+ @user = Facebooker::User.new(1234, @session)
9
+ @other_user = Facebooker::User.new(4321, @session)
10
+ ENV['FACEBOOK_CANVAS_PATH'] ='facebook_app_name'
11
+ ENV['FACEBOOK_API_KEY'] = '1234567'
12
+ ENV['FACEBOOK_SECRET_KEY'] = '7654321'
13
+
14
+ @user.friends = [@other_user]
15
+ end
16
+
17
+ def test_has_permission
18
+ expect_http_posts_with_responses(has_app_permission_response_xml)
19
+ assert @user.has_permission?("status_update")
20
+ end
21
+
22
+ def test_can_ask_user_if_he_or_she_is_friends_with_another_user
23
+ assert(@user.friends_with?(@other_user))
24
+ end
25
+
26
+ def test_can_ask_user_if_he_or_she_is_friends_with_another_user_by_user_id
27
+ assert(@user.friends_with?(@other_user.id))
28
+ end
29
+
30
+ def test_does_not_query_facebook_for_uid
31
+ @session.expects(:post).never
32
+ assert_equal 1234, Facebooker::User.new(1234, @session).uid
33
+ end
34
+
35
+ def test_uid_is_always_an_integer
36
+ assert_equal 1234, Facebooker::User.new(:uid => "1234").uid
37
+ assert_equal 1234, Facebooker::User.new(:id => "1234").uid
38
+
39
+ assert_equal 1234, Facebooker::User.new(:uid => "1234").id
40
+ assert_equal 1234, Facebooker::User.new(:id => "1234").id
41
+
42
+ assert_equal 1234, Facebooker::User.new(:uid => "1234").facebook_id
43
+ assert_equal 1234, Facebooker::User.new(:id => "1234").facebook_id
44
+ end
45
+
46
+ def test_cast_to_friend_list_id_with_nil
47
+ assert_nil @user.cast_to_friend_list_id(nil)
48
+ end
49
+ def test_cast_to_friend_list_id_with_integer
50
+ assert_equal 14,@user.cast_to_friend_list_id(14)
51
+ end
52
+ def test_cast_to_friend_list_id_with_string
53
+ @user.expects(:friend_lists).returns([Facebooker::FriendList.new(:flid=>199,:name=>"Work")])
54
+ assert_equal 199,@user.cast_to_friend_list_id("Work")
55
+ end
56
+ def test_cast_to_friend_list_id_with_friend_list
57
+ assert_equal 199,@user.cast_to_friend_list_id(Facebooker::FriendList.new(:flid=>199,:name=>"Work"))
58
+ end
59
+
60
+ def test_cast_to_friend_list_id_with_invalid_string_raises
61
+ @user.expects(:friend_lists).returns([Facebooker::FriendList.new(:flid=>1,:name=>"Not Picked")])
62
+ assert_nil @user.cast_to_friend_list_id("Something")
63
+ fail("No exception raised, Expected Facebooker::Session::InvalidFriendList")
64
+ rescue Facebooker::Session::InvalidFriendList
65
+ nil
66
+ end
67
+
68
+ def test_can_create_from_current_session
69
+ Facebooker::Session.expects(:current).returns("current")
70
+ user=Facebooker::User.new(1)
71
+ assert_equal("current",user.session)
72
+ end
73
+
74
+ def test_raises_when_no_session_bound
75
+ assert_raises(Facebooker::Model::UnboundSessionException) { Facebooker::User.new(1, nil).populate }
76
+ end
77
+
78
+ def test_can_set_mobile_fbml
79
+ @user.expects(:set_profile_fbml).with(nil,"test",nil)
80
+ @user.mobile_fbml="test"
81
+ end
82
+ def test_can_set_profile_action
83
+ @user.expects(:set_profile_fbml).with(nil,nil,"test")
84
+ @user.profile_action="test"
85
+ end
86
+ def test_can_set_profile_fbml
87
+ @user.expects(:set_profile_fbml).with("test",nil,nil)
88
+ @user.profile_fbml="test"
89
+ end
90
+
91
+ def test_can_set_profile_main
92
+ @user.expects(:set_profile_fbml).with(nil,nil,nil,"test")
93
+ @user.profile_main="test"
94
+ end
95
+
96
+ def test_can_call_set_profile_fbml
97
+ @session.expects(:post).with('facebook.profile.setFBML', {:uid=>1234,:profile=>"profile",:profile_action=>"action",:mobile_profile=>"mobile"},false)
98
+ @user.set_profile_fbml("profile","mobile","action")
99
+ end
100
+
101
+ def test_can_call_set_profile_fbml_with_profile_main
102
+ @session.expects(:post).with('facebook.profile.setFBML', {:uid=>1234,:profile=>"profile",:profile_action=>"action",:mobile_profile=>"mobile", :profile_main => 'profile_main'},false)
103
+ @user.set_profile_fbml("profile","mobile","action",'profile_main')
104
+ end
105
+
106
+ def test_can_get_profile_photos
107
+ @user.expects(:profile_photos)
108
+ @user.profile_photos
109
+ end
110
+
111
+ def test_can_set_cookie
112
+ @user.expects(:set_cookie).with('name', 'value')
113
+ @user.set_cookie('name', 'value')
114
+ end
115
+
116
+ def test_can_get_cookies
117
+ @user.expects(:get_cookies).with('name')
118
+ @user.get_cookies('name')
119
+ end
120
+
121
+ def test_get_profile_photos
122
+ @user = Facebooker::User.new(548871286, @session)
123
+ expect_http_posts_with_responses(example_profile_photos_get_xml)
124
+ photos = @user.profile_photos
125
+ assert_equal "2357384227378429949", photos.first.aid
126
+ end
127
+
128
+ def test_can_send_email
129
+ @user.expects(:send_email).with("subject", "body text")
130
+ @user.send_email("subject", "body text")
131
+
132
+ @user.expects(:send_email).with("subject", nil, "body fbml")
133
+ @user.send_email("subject", nil, "body fbml")
134
+ end
135
+
136
+ def test_doesnt_post_to_facebook_when_assigning_status
137
+ @session.expects(:post).never
138
+ @user.status="my status"
139
+ end
140
+ def test_can_set_status_with_string
141
+ @session.expects(:post).with('facebook.users.setStatus', {:status=>"my status",:status_includes_verb=>1, :uid => @user.uid}, false)
142
+ @user.set_status("my status")
143
+ end
144
+
145
+ def test_get_events
146
+ @user = Facebooker::User.new(9507801, @session)
147
+ expect_http_posts_with_responses(example_events_get_xml)
148
+ events = @user.events
149
+ assert_equal 29511517904, events.first.eid
150
+ end
151
+
152
+ def test_events_caching_honors_params
153
+ @user = Facebooker::User.new(9507801, @session)
154
+ @session.expects(:post).returns([{:eid=>1}])
155
+ assert_equal 1,@user.events.first.eid
156
+ @session.expects(:post).returns([{:eid=>2}])
157
+ assert_equal 2,@user.events(:start_time=>1.day.ago).first.eid
158
+ @session.expects(:post).never
159
+ assert_equal 1,@user.events.first.eid
160
+ end
161
+
162
+
163
+ def test_to_s
164
+ assert_equal("1234",@user.to_s)
165
+ end
166
+
167
+ def test_equality_with_same_id
168
+ assert_equal @user, @user.dup
169
+ assert_equal @user, Facebooker::User.new(:id => @user.id)
170
+ end
171
+
172
+ def test_not_equal_to_differnt_class
173
+ assert_not_equal @user, flexmock(:id => @user.id)
174
+ end
175
+
176
+ def test_hash_email
177
+ assert_equal "4228600737_c96da02bba97aedfd26136e980ae3761", Facebooker::User.hash_email("mary@example.com")
178
+ end
179
+ def test_hash_email_not_normalized
180
+ assert_equal "4228600737_c96da02bba97aedfd26136e980ae3761", Facebooker::User.hash_email(" MaRy@example.com ")
181
+ end
182
+
183
+ def test_register_with_array
184
+ expect_http_posts_with_responses(register_response_xml)
185
+ assert_equal ["4228600737_c96da02bba97aedfd26136e980ae3761"],Facebooker::User.register([{:email=>"mary@example.com",:account_id=>1}])
186
+ end
187
+
188
+ def test_register_with_array_raises_if_not_all_success
189
+ expect_http_posts_with_responses(register_response_xml)
190
+ assert_equal ["4228600737_c96da02bba97aedfd26136e980ae3761"],Facebooker::User.register([{:email=>"mary@example.com",:account_id=>1},{:email=>"mike@example.com",:account_id=>2}])
191
+ fail "Should have raised Facebooker::Session::UserRegistrationFailed"
192
+ rescue Facebooker::Session::UserRegistrationFailed => e
193
+ assert_equal({:email=>"mike@example.com",:account_id=>2},e.failed_users.first)
194
+ end
195
+
196
+ def test_get_locale
197
+ @user = Facebooker::User.new(9507801, @session)
198
+ expect_http_posts_with_responses(example_users_get_info_xml)
199
+ assert_equal "en_US", @user.locale
200
+ end
201
+
202
+ def test_get_profile_url
203
+ @user = Facebooker::User.new(8055, @session)
204
+ expect_http_posts_with_responses(example_users_get_info_xml)
205
+ assert_equal "http://www.facebook.com/profile.php?id=8055", @user.profile_url
206
+ end
207
+
208
+ private
209
+ def example_profile_photos_get_xml
210
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
211
+ <photos_get_response xmlns=\"http://api.facebook.com/1.0/\"
212
+ xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
213
+ xsi:schemaLocation=\"http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd\" list=\"true\">
214
+ <photo>
215
+ <pid>34585991612804</pid>
216
+ <aid>2357384227378429949</aid>
217
+ <owner>1240077</owner>
218
+ <src>http://ip002.facebook.com/v11/135/18/8055/s1240077_30043524_2020.jpg</src>
219
+ <src_big>http://ip002.facebook.com/v11/135/18/8055/n1240077_30043524_2020.jpg</src_big>
220
+ <src_small>http://ip002.facebook.com/v11/135/18/8055/t1240077_30043524_2020.jpg</src_small>
221
+ <link>http://www.facebook.com/photo.php?pid=30043524&id=8055</link>
222
+ <caption>From The Deathmatch (Trailer) (1999)</caption>
223
+ <created>1132553361</created>
224
+ </photo>
225
+ <photo>
226
+ <pid>34585991612805</pid>
227
+ <aid>2357384227378429949</aid>
228
+ <owner>1240077</owner>
229
+ <src>http://ip002.facebook.com/v11/135/18/8055/s1240077_30043525_2184.jpg</src>
230
+ <src_big>http://ip002.facebook.com/v11/135/18/8055/n1240077_30043525_2184.jpg</src_big>
231
+ <src_small>http://ip002.facebook.com/v11/135/18/8055/t1240077_30043525_2184.jpg</src_small>
232
+ <link>http://www.facebook.com/photo.php?pid=30043525&id=8055</link>
233
+ <caption>Mexico City, back cover of the CYHS Student Underground 1999.</caption>
234
+ <created>1132553362</created>
235
+ </photo>
236
+ </photos_get_response>"
237
+ end
238
+
239
+ def example_events_get_xml
240
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
241
+ <events_get_response xmlns=\"http://api.facebook.com/1.0/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd\" list=\"true\">
242
+ <event>
243
+ <eid>29511517904</eid>
244
+ <name>PUMA SALE</name>
245
+ <tagline/>
246
+ <nid>0</nid>
247
+ <pic>http://profile.ak.facebook.com/object3/370/66/s29511517904_6952.jpg</pic>
248
+ <pic_big>http://profile.ak.facebook.com/object3/370/66/n29511517904_6952.jpg</pic_big>
249
+ <pic_small>http://profile.ak.facebook.com/object3/370/66/t29511517904_6952.jpg</pic_small>
250
+ <host>PUMA</host>
251
+ <description>PUMA SALE</description>
252
+ <event_type>Education</event_type>
253
+ <event_subtype>Study Group</event_subtype>
254
+ <start_time>1212166800</start_time>
255
+ <end_time>1212364800</end_time>
256
+ <creator>1234261165</creator>
257
+ <update_time>1209768148</update_time>
258
+ <location>PUMA LOT</location>
259
+ <venue>
260
+ <street>5 LYBERTY WAY</street>
261
+ <city>Westford</city>
262
+ <state>Massachusetts</state>
263
+ <country>United States</country>
264
+ <latitude>42.5792</latitude>
265
+ <longitude>-71.4383</longitude>
266
+ </venue>
267
+ </event>
268
+ </events_get_response>"
269
+ end
270
+
271
+ def example_users_get_info_xml
272
+ <<-XML
273
+ <?xml version="1.0" encoding="UTF-8"?> <users_getInfo_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true"> <user> <uid>8055</uid> <about_me>This field perpetuates the glorification of the ego. Also, it has a character limit.</about_me> <activities>Here: facebook, etc. There: Glee Club, a capella, teaching.</activities> <affiliations list="true"> <affiliation> <nid>50453093</nid> <name>Facebook Developers</name> <type>work</type> <status/> <year/> </affiliation> </affiliations> <birthday>November 3</birthday> <books>The Brothers K, GEB, Ken Wilber, Zen and the Art, Fitzgerald, The Emporer's New Mind, The Wonderful Story of Henry Sugar</books> <current_location> <city>Palo Alto</city> <state>CA</state> <country>United States</country> <zip>94303</zip> </current_location> <education_history list="true"> <education_info> <name>Harvard</name> <year>2003</year> <concentrations list="true"> <concentration>Applied Mathematics</concentration> <concentration>Computer Science</concentration> </concentrations> </education_info> </education_history> <first_name>Dave</first_name> <hometown_location> <city>York</city> <state>PA</state> <country>United States</country> </hometown_location> <hs_info> <hs1_name>Central York High School</hs1_name> <hs2_name/> <grad_year>1999</grad_year> <hs1_id>21846</hs1_id> <hs2_id>0</hs2_id> </hs_info> <is_app_user>1</is_app_user> <has_added_app>1</has_added_app> <interests>coffee, computers, the funny, architecture, code breaking,snowboarding, philosophy, soccer, talking to strangers</interests> <last_name>Fetterman</last_name> <locale>en_US</locale> <meeting_for list="true"> <seeking>Friendship</seeking> </meeting_for> <meeting_sex list="true"> <sex>female</sex> </meeting_sex> <movies>Tommy Boy, Billy Madison, Fight Club, Dirty Work, Meet the Parents, My Blue Heaven, Office Space </movies> <music>New Found Glory, Daft Punk, Weezer, The Crystal Method, Rage, the KLF, Green Day, Live, Coldplay, Panic at the Disco, Family Force 5</music> <name>Dave Fetterman</name> <notes_count>0</notes_count> <pic>http://photos-055.facebook.com/ip007/profile3/1271/65/s8055_39735.jpg</pic> <pic_big>http://photos-055.facebook.com/ip007/profile3/1271/65/n8055_39735.jpg</pic_big> <pic_small>http://photos-055.facebook.com/ip007/profile3/1271/65/t8055_39735.jpg</pic_small> <pic_square>http://photos-055.facebook.com/ip007/profile3/1271/65/q8055_39735.jpg</pic_square> <political>Moderate</political> <profile_update_time>1170414620</profile_update_time> <profile_url>http://www.facebook.com/profile.php?id=8055</profile_url> <quotes/> <relationship_status>In a Relationship</relationship_status> <religion/> <sex>male</sex> <significant_other_id xsi:nil="true"/> <status> <message>Fast Company, November issue, page 84</message> <time>1193075616</time> </status> <timezone>-8</timezone> <tv>cf. Bob Trahan</tv> <wall_count>121</wall_count> <work_history list="true"> <work_info> <location> <city>Palo Alto</city> <state>CA</state> <country>United States</country> </location> <company_name>Facebook</company_name> <position>Software Engineer</position> <description>Tech Lead, Facebook Platform</description> <start_date>2006-01</start_date> <end_date/> </work_info> </work_history> </user> </users_getInfo_response>
274
+ XML
275
+ end
276
+
277
+ def register_response_xml
278
+ <<-XML
279
+ <?xml version="1.0" encoding="UTF-8"?>
280
+ <connect_registerUsers_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/facebook.xsd" list="true">
281
+ <connect_registerUsers_response_elt>4228600737_c96da02bba97aedfd26136e980ae3761</connect_registerUsers_response_elt>
282
+ </connect_registerUsers_response>
283
+ XML
284
+ end
285
+
286
+ def has_app_permission_response_xml
287
+ <<-XML
288
+ <?xml version="1.0" encoding="UTF-8"?>
289
+ <users_hasAppPermission_response xmlns="http://api.facebook.com/1.0/"
290
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
291
+ xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd">1</users_hasAppPermission_response>
292
+ XML
293
+ end
294
+
295
+ end