facebooker 1.0.13 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +29 -16
- data/Rakefile +9 -2
- data/generators/facebook/templates/public/javascripts/facebooker.js +1 -8
- data/init.rb +3 -1
- data/lib/facebooker.rb +4 -2
- data/lib/facebooker/adapters/facebook_adapter.rb +4 -0
- data/lib/facebooker/admin.rb +2 -2
- data/lib/facebooker/mobile.rb +20 -0
- data/lib/facebooker/mock/service.rb +50 -0
- data/lib/facebooker/mock/session.rb +18 -0
- data/lib/facebooker/model.rb +3 -3
- data/lib/facebooker/models/applicationrestrictions.rb +10 -0
- data/lib/facebooker/models/user.rb +35 -3
- data/lib/facebooker/models/user.rb.orig +396 -0
- data/lib/facebooker/models/user.rb.rej +17 -0
- data/lib/facebooker/models/video.rb +9 -0
- data/lib/facebooker/parser.rb +22 -1
- data/lib/facebooker/rails/controller.rb +34 -12
- data/lib/facebooker/rails/cucumber.rb +28 -0
- data/lib/facebooker/rails/cucumber/world.rb +46 -0
- data/lib/facebooker/rails/facebook_pretty_errors.rb +19 -11
- data/lib/facebooker/rails/helpers.rb +203 -122
- data/lib/facebooker/rails/helpers/fb_connect.rb +56 -5
- data/lib/facebooker/rails/integration_session.rb +38 -0
- data/lib/facebooker/rails/publisher.rb +15 -2
- data/lib/facebooker/rails/test_helpers.rb +11 -26
- data/lib/facebooker/service.rb +6 -3
- data/lib/facebooker/session.rb +24 -2
- data/lib/facebooker/session.rb.orig +564 -0
- data/lib/facebooker/session.rb.rej +29 -0
- data/lib/facebooker/version.rb +1 -1
- data/lib/tasks/tunnel.rake +2 -2
- data/test/{adapters_test.rb → facebooker/adapters_test.rb} +2 -4
- data/test/{facebook_admin_test.rb → facebooker/admin_test.rb} +2 -2
- data/test/{batch_request_test.rb → facebooker/batch_request_test.rb} +3 -2
- data/test/{facebook_data_test.rb → facebooker/data_test.rb} +2 -2
- data/test/{logging_test.rb → facebooker/logging_test.rb} +3 -3
- data/test/facebooker/mobile_test.rb +45 -0
- data/test/{model_test.rb → facebooker/model_test.rb} +36 -4
- data/test/{event_test.rb → facebooker/models/event_test.rb} +2 -2
- data/test/{user_test.rb → facebooker/models/user_test.rb} +10 -5
- data/test/{publisher_test.rb → facebooker/rails/publisher_test.rb} +12 -18
- data/test/{rails_integration_test.rb → facebooker/rails_integration_test.rb} +347 -272
- data/test/{facebook_cache_test.rb → facebooker/server_cache_test.rb} +1 -1
- data/test/{session_test.rb → facebooker/session_test.rb} +3 -2
- data/test/facebooker_test.rb +19 -1
- data/test/{http_multipart_post_test.rb → net/http_multipart_post_test.rb} +2 -4
- data/test/rails_test_helper.rb +11 -0
- data/test/test_helper.rb +8 -2
- metadata +45 -32
- data/lib/facebooker/rails/facebook_asset_path.rb +0 -18
@@ -1,6 +1,7 @@
|
|
1
|
-
require File.dirname(__FILE__) + '
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
2
|
+
require 'active_support'
|
2
3
|
|
3
|
-
class SessionTest < Test::Unit::TestCase
|
4
|
+
class Facebooker::SessionTest < Test::Unit::TestCase
|
4
5
|
|
5
6
|
|
6
7
|
def setup
|
data/test/facebooker_test.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/test_helper
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
|
2
2
|
require 'net/http_multipart_post'
|
3
3
|
class TestFacebooker < Test::Unit::TestCase
|
4
4
|
|
@@ -283,6 +283,13 @@ class TestFacebooker < Test::Unit::TestCase
|
|
283
283
|
assert_equal ['65.4248', '16.8627'], tag.coordinates
|
284
284
|
end
|
285
285
|
|
286
|
+
def test_can_upload_video
|
287
|
+
mock_http = establish_session
|
288
|
+
mock_http.should_receive(:post_multipart_form).and_return(example_upload_video_xml).once
|
289
|
+
f = Net::HTTP::MultipartPostFile.new("party.mp4", "video/mpeg", "RAW DATA")
|
290
|
+
assert_equal "Some Epic", @session.user.upload_video(f).title
|
291
|
+
end
|
292
|
+
|
286
293
|
def test_can_get_app_profile_fbml_for_user
|
287
294
|
expect_http_posts_with_responses(example_get_fbml_xml)
|
288
295
|
assert_match(/My profile!/, @session.user.profile_fbml)
|
@@ -904,4 +911,15 @@ class TestFacebooker < Test::Unit::TestCase
|
|
904
911
|
XML
|
905
912
|
end
|
906
913
|
|
914
|
+
def example_upload_video_xml
|
915
|
+
<<-XML
|
916
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
917
|
+
<video_upload_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">
|
918
|
+
<vid>15943367753</vid>
|
919
|
+
<title>Some Epic</title>
|
920
|
+
<description>Check it out</description>
|
921
|
+
<link>http://www.facebook.com/video/video.php?v=15943367753</link>
|
922
|
+
</video_upload_response>
|
923
|
+
XML
|
924
|
+
end
|
907
925
|
end
|
@@ -1,6 +1,4 @@
|
|
1
|
-
require File.dirname(__FILE__) + '
|
2
|
-
require 'rubygems'
|
3
|
-
require 'flexmock/test_unit'
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
4
2
|
require 'net/http_multipart_post'
|
5
3
|
|
6
4
|
class HttpMulitpartPostTest < Test::Unit::TestCase
|
@@ -9,7 +7,7 @@ class HttpMulitpartPostTest < Test::Unit::TestCase
|
|
9
7
|
end
|
10
8
|
|
11
9
|
def fixture(string)
|
12
|
-
File.open(File.dirname(__FILE__) + "
|
10
|
+
File.open(File.dirname(__FILE__) + "/../fixtures/#{string}.txt").read
|
13
11
|
end
|
14
12
|
|
15
13
|
def test_multipart_post_with_only_parameters
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/test_helper')
|
2
|
+
|
3
|
+
require 'action_controller'
|
4
|
+
require 'action_controller/test_process'
|
5
|
+
require 'active_record'
|
6
|
+
require File.dirname(__FILE__)+'/../init'
|
7
|
+
require 'facebooker/rails/controller'
|
8
|
+
require 'facebooker/rails/helpers/fb_connect'
|
9
|
+
require 'facebooker/rails/helpers'
|
10
|
+
require 'facebooker/rails/publisher'
|
11
|
+
require 'facebooker/rails/facebook_form_builder'
|
data/test/test_helper.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
require 'test/unit'
|
2
2
|
require 'rubygems'
|
3
|
+
begin
|
4
|
+
require 'multi_rails_init'
|
5
|
+
rescue LoadError
|
6
|
+
# multi rails not installed, test against newest supported version of Rails
|
7
|
+
gem 'rails', '2.2.2'
|
8
|
+
end
|
3
9
|
require 'flexmock/test_unit'
|
4
10
|
require 'mocha'
|
5
11
|
|
6
|
-
require File.dirname(__FILE__)+'/../lib/facebooker/rails/test_helpers'
|
7
|
-
|
8
12
|
$: << File.join(File.dirname(__FILE__), '..', 'lib')
|
9
13
|
|
10
14
|
rails_root = File.join(File.dirname(__FILE__),'..','..')
|
@@ -15,6 +19,8 @@ else
|
|
15
19
|
end
|
16
20
|
|
17
21
|
require 'facebooker'
|
22
|
+
require 'facebooker/rails/test_helpers'
|
23
|
+
|
18
24
|
|
19
25
|
class Test::Unit::TestCase
|
20
26
|
include Facebooker::Rails::TestHelpers
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facebooker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Fowler
|
@@ -13,7 +13,7 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2009-
|
16
|
+
date: 2009-03-23 00:00:00 -04:00
|
17
17
|
default_executable:
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
@@ -95,7 +95,6 @@ files:
|
|
95
95
|
- generators/xd_receiver/templates/xd_receiver.html
|
96
96
|
- init.rb
|
97
97
|
- install.rb
|
98
|
-
- lib/facebooker.rb
|
99
98
|
- lib/facebooker/adapters/adapter_base.rb
|
100
99
|
- lib/facebooker/adapters/bebo_adapter.rb
|
101
100
|
- lib/facebooker/adapters/facebook_adapter.rb
|
@@ -104,10 +103,14 @@ files:
|
|
104
103
|
- lib/facebooker/data.rb
|
105
104
|
- lib/facebooker/feed.rb
|
106
105
|
- lib/facebooker/logging.rb
|
106
|
+
- lib/facebooker/mock/service.rb
|
107
|
+
- lib/facebooker/mock/session.rb
|
108
|
+
- lib/facebooker/mobile.rb
|
107
109
|
- lib/facebooker/model.rb
|
108
110
|
- lib/facebooker/models/affiliation.rb
|
109
111
|
- lib/facebooker/models/album.rb
|
110
112
|
- lib/facebooker/models/applicationproperties.rb
|
113
|
+
- lib/facebooker/models/applicationrestrictions.rb
|
111
114
|
- lib/facebooker/models/cookie.rb
|
112
115
|
- lib/facebooker/models/education_info.rb
|
113
116
|
- lib/facebooker/models/event.rb
|
@@ -121,18 +124,23 @@ files:
|
|
121
124
|
- lib/facebooker/models/photo.rb
|
122
125
|
- lib/facebooker/models/tag.rb
|
123
126
|
- lib/facebooker/models/user.rb
|
127
|
+
- lib/facebooker/models/user.rb.orig
|
128
|
+
- lib/facebooker/models/user.rb.rej
|
129
|
+
- lib/facebooker/models/video.rb
|
124
130
|
- lib/facebooker/models/work_info.rb
|
125
131
|
- lib/facebooker/parser.rb
|
126
132
|
- lib/facebooker/rails/controller.rb
|
127
|
-
- lib/facebooker/rails/
|
133
|
+
- lib/facebooker/rails/cucumber/world.rb
|
134
|
+
- lib/facebooker/rails/cucumber.rb
|
128
135
|
- lib/facebooker/rails/facebook_form_builder.rb
|
129
136
|
- lib/facebooker/rails/facebook_pretty_errors.rb
|
130
137
|
- lib/facebooker/rails/facebook_request_fix.rb
|
131
138
|
- lib/facebooker/rails/facebook_session_handling.rb
|
132
139
|
- lib/facebooker/rails/facebook_url_helper.rb
|
133
140
|
- lib/facebooker/rails/facebook_url_rewriting.rb
|
134
|
-
- lib/facebooker/rails/helpers.rb
|
135
141
|
- lib/facebooker/rails/helpers/fb_connect.rb
|
142
|
+
- lib/facebooker/rails/helpers.rb
|
143
|
+
- lib/facebooker/rails/integration_session.rb
|
136
144
|
- lib/facebooker/rails/profile_publisher_extensions.rb
|
137
145
|
- lib/facebooker/rails/publisher.rb
|
138
146
|
- lib/facebooker/rails/routing.rb
|
@@ -141,31 +149,36 @@ files:
|
|
141
149
|
- lib/facebooker/server_cache.rb
|
142
150
|
- lib/facebooker/service.rb
|
143
151
|
- lib/facebooker/session.rb
|
152
|
+
- lib/facebooker/session.rb.orig
|
153
|
+
- lib/facebooker/session.rb.rej
|
144
154
|
- lib/facebooker/version.rb
|
155
|
+
- lib/facebooker.rb
|
145
156
|
- lib/net/http_multipart_post.rb
|
146
157
|
- lib/tasks/facebooker.rake
|
147
158
|
- lib/tasks/tunnel.rake
|
148
159
|
- rails/init.rb
|
149
160
|
- setup.rb
|
150
161
|
- templates/layout.erb
|
151
|
-
- test/adapters_test.rb
|
152
|
-
- test/
|
153
|
-
- test/
|
154
|
-
- test/
|
155
|
-
- test/
|
156
|
-
- test/
|
162
|
+
- test/facebooker/adapters_test.rb
|
163
|
+
- test/facebooker/admin_test.rb
|
164
|
+
- test/facebooker/batch_request_test.rb
|
165
|
+
- test/facebooker/data_test.rb
|
166
|
+
- test/facebooker/logging_test.rb
|
167
|
+
- test/facebooker/model_test.rb
|
168
|
+
- test/facebooker/models/event_test.rb
|
169
|
+
- test/facebooker/models/user_test.rb
|
170
|
+
- test/facebooker/rails/publisher_test.rb
|
171
|
+
- test/facebooker/rails_integration_test.rb
|
172
|
+
- test/facebooker/server_cache_test.rb
|
173
|
+
- test/facebooker/session_test.rb
|
157
174
|
- test/facebooker_test.rb
|
158
175
|
- test/fixtures/multipart_post_body_with_only_parameters.txt
|
159
176
|
- test/fixtures/multipart_post_body_with_single_file.txt
|
160
177
|
- test/fixtures/multipart_post_body_with_single_file_that_has_nil_key.txt
|
161
|
-
- test/http_multipart_post_test.rb
|
162
|
-
- test/
|
163
|
-
- test/model_test.rb
|
164
|
-
- test/publisher_test.rb
|
165
|
-
- test/rails_integration_test.rb
|
166
|
-
- test/session_test.rb
|
178
|
+
- test/net/http_multipart_post_test.rb
|
179
|
+
- test/rails_test_helper.rb
|
167
180
|
- test/test_helper.rb
|
168
|
-
- test/
|
181
|
+
- test/facebooker/mobile_test.rb
|
169
182
|
has_rdoc: true
|
170
183
|
homepage:
|
171
184
|
post_install_message:
|
@@ -194,18 +207,18 @@ signing_key:
|
|
194
207
|
specification_version: 2
|
195
208
|
summary: Pure, idiomatic Ruby wrapper for the Facebook REST API.
|
196
209
|
test_files:
|
197
|
-
- test/adapters_test.rb
|
198
|
-
- test/batch_request_test.rb
|
199
|
-
- test/event_test.rb
|
200
|
-
- test/facebook_admin_test.rb
|
201
|
-
- test/facebook_cache_test.rb
|
202
|
-
- test/facebook_data_test.rb
|
203
210
|
- test/facebooker_test.rb
|
204
|
-
- test/
|
205
|
-
- test/
|
206
|
-
- test/
|
207
|
-
- test/
|
208
|
-
- test/
|
209
|
-
- test/
|
210
|
-
- test/
|
211
|
-
- test/
|
211
|
+
- test/facebooker/adapters_test.rb
|
212
|
+
- test/facebooker/admin_test.rb
|
213
|
+
- test/facebooker/batch_request_test.rb
|
214
|
+
- test/facebooker/data_test.rb
|
215
|
+
- test/facebooker/logging_test.rb
|
216
|
+
- test/facebooker/mobile_test.rb
|
217
|
+
- test/facebooker/model_test.rb
|
218
|
+
- test/facebooker/rails_integration_test.rb
|
219
|
+
- test/facebooker/server_cache_test.rb
|
220
|
+
- test/facebooker/session_test.rb
|
221
|
+
- test/facebooker/models/event_test.rb
|
222
|
+
- test/facebooker/models/user_test.rb
|
223
|
+
- test/facebooker/rails/publisher_test.rb
|
224
|
+
- test/net/http_multipart_post_test.rb
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# module ActionView
|
2
|
-
# module Helpers
|
3
|
-
# module AssetTagHelper
|
4
|
-
# def compute_public_path_with_facebooker(*args)
|
5
|
-
# public_path=compute_public_path_without_facebooker(*args)
|
6
|
-
# if public_path.starts_with?(ActionController::Base.asset_host)
|
7
|
-
# str=ActionController::Base.asset_host
|
8
|
-
# str += "/" unless str.ends_with?("/")
|
9
|
-
# public_path.gsub(/#{Regexp.escape(ActionController::Base.asset_host)}#{@controller.request.relative_url_root}\//,str)
|
10
|
-
# else
|
11
|
-
# public_path
|
12
|
-
# end
|
13
|
-
# end
|
14
|
-
#
|
15
|
-
# alias_method_chain :compute_public_path, :facebooker
|
16
|
-
# end
|
17
|
-
# end
|
18
|
-
# end
|