mmangino-facebooker 1.0.15 → 1.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +27 -16
- data/Rakefile +1 -1
- data/generators/facebook/templates/public/javascripts/facebooker.js +1 -8
- data/init.rb +3 -1
- data/lib/facebooker.rb +2 -1
- data/lib/facebooker/adapters/facebook_adapter.rb +4 -0
- data/lib/facebooker/mock/service.rb +50 -0
- data/lib/facebooker/mock/session.rb +18 -0
- data/lib/facebooker/model.rb +2 -2
- data/lib/facebooker/models/applicationrestrictions.rb +10 -0
- data/lib/facebooker/models/user.rb +33 -1
- data/lib/facebooker/models/video.rb +9 -0
- data/lib/facebooker/parser.rb +8 -1
- data/lib/facebooker/rails/controller.rb +15 -3
- data/lib/facebooker/rails/cucumber.rb +30 -0
- data/lib/facebooker/rails/cucumber/world.rb +46 -0
- data/lib/facebooker/rails/helpers.rb +203 -122
- data/lib/facebooker/rails/helpers/fb_connect.rb +25 -3
- data/lib/facebooker/rails/integration_session.rb +40 -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 +19 -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/{model_test.rb → facebooker/model_test.rb} +2 -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} +126 -115
- 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 +2 -2
- metadata +28 -17
- 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
@@ -3,8 +3,6 @@ require 'rubygems'
|
|
3
3
|
require 'flexmock/test_unit'
|
4
4
|
require 'mocha'
|
5
5
|
|
6
|
-
require File.dirname(__FILE__)+'/../lib/facebooker/rails/test_helpers'
|
7
|
-
|
8
6
|
$: << File.join(File.dirname(__FILE__), '..', 'lib')
|
9
7
|
|
10
8
|
rails_root = File.join(File.dirname(__FILE__),'..','..')
|
@@ -15,6 +13,8 @@ else
|
|
15
13
|
end
|
16
14
|
|
17
15
|
require 'facebooker'
|
16
|
+
require 'facebooker/rails/test_helpers'
|
17
|
+
|
18
18
|
|
19
19
|
class Test::Unit::TestCase
|
20
20
|
include Facebooker::Rails::TestHelpers
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mmangino-facebooker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Fowler
|
@@ -84,7 +84,6 @@ files:
|
|
84
84
|
- generators/xd_receiver/templates/xd_receiver.html
|
85
85
|
- init.rb
|
86
86
|
- install.rb
|
87
|
-
- lib/facebooker.rb
|
88
87
|
- lib/facebooker/adapters/adapter_base.rb
|
89
88
|
- lib/facebooker/adapters/bebo_adapter.rb
|
90
89
|
- lib/facebooker/adapters/facebook_adapter.rb
|
@@ -93,10 +92,13 @@ files:
|
|
93
92
|
- lib/facebooker/data.rb
|
94
93
|
- lib/facebooker/feed.rb
|
95
94
|
- lib/facebooker/logging.rb
|
95
|
+
- lib/facebooker/mock/service.rb
|
96
|
+
- lib/facebooker/mock/session.rb
|
96
97
|
- lib/facebooker/model.rb
|
97
98
|
- lib/facebooker/models/affiliation.rb
|
98
99
|
- lib/facebooker/models/album.rb
|
99
100
|
- lib/facebooker/models/applicationproperties.rb
|
101
|
+
- lib/facebooker/models/applicationrestrictions.rb
|
100
102
|
- lib/facebooker/models/cookie.rb
|
101
103
|
- lib/facebooker/models/education_info.rb
|
102
104
|
- lib/facebooker/models/event.rb
|
@@ -110,18 +112,23 @@ files:
|
|
110
112
|
- lib/facebooker/models/photo.rb
|
111
113
|
- lib/facebooker/models/tag.rb
|
112
114
|
- lib/facebooker/models/user.rb
|
115
|
+
- lib/facebooker/models/user.rb.orig
|
116
|
+
- lib/facebooker/models/user.rb.rej
|
117
|
+
- lib/facebooker/models/video.rb
|
113
118
|
- lib/facebooker/models/work_info.rb
|
114
119
|
- lib/facebooker/parser.rb
|
115
120
|
- lib/facebooker/rails/controller.rb
|
116
|
-
- lib/facebooker/rails/
|
121
|
+
- lib/facebooker/rails/cucumber/world.rb
|
122
|
+
- lib/facebooker/rails/cucumber.rb
|
117
123
|
- lib/facebooker/rails/facebook_form_builder.rb
|
118
124
|
- lib/facebooker/rails/facebook_pretty_errors.rb
|
119
125
|
- lib/facebooker/rails/facebook_request_fix.rb
|
120
126
|
- lib/facebooker/rails/facebook_session_handling.rb
|
121
127
|
- lib/facebooker/rails/facebook_url_helper.rb
|
122
128
|
- lib/facebooker/rails/facebook_url_rewriting.rb
|
123
|
-
- lib/facebooker/rails/helpers.rb
|
124
129
|
- lib/facebooker/rails/helpers/fb_connect.rb
|
130
|
+
- lib/facebooker/rails/helpers.rb
|
131
|
+
- lib/facebooker/rails/integration_session.rb
|
125
132
|
- lib/facebooker/rails/profile_publisher_extensions.rb
|
126
133
|
- lib/facebooker/rails/publisher.rb
|
127
134
|
- lib/facebooker/rails/routing.rb
|
@@ -130,31 +137,35 @@ files:
|
|
130
137
|
- lib/facebooker/server_cache.rb
|
131
138
|
- lib/facebooker/service.rb
|
132
139
|
- lib/facebooker/session.rb
|
140
|
+
- lib/facebooker/session.rb.orig
|
141
|
+
- lib/facebooker/session.rb.rej
|
133
142
|
- lib/facebooker/version.rb
|
143
|
+
- lib/facebooker.rb
|
134
144
|
- lib/net/http_multipart_post.rb
|
135
145
|
- lib/tasks/facebooker.rake
|
136
146
|
- lib/tasks/tunnel.rake
|
137
147
|
- rails/init.rb
|
138
148
|
- setup.rb
|
139
149
|
- templates/layout.erb
|
140
|
-
- test/adapters_test.rb
|
141
|
-
- test/
|
142
|
-
- test/
|
143
|
-
- test/
|
144
|
-
- test/
|
145
|
-
- test/
|
150
|
+
- test/facebooker/adapters_test.rb
|
151
|
+
- test/facebooker/admin_test.rb
|
152
|
+
- test/facebooker/batch_request_test.rb
|
153
|
+
- test/facebooker/data_test.rb
|
154
|
+
- test/facebooker/logging_test.rb
|
155
|
+
- test/facebooker/model_test.rb
|
156
|
+
- test/facebooker/models/event_test.rb
|
157
|
+
- test/facebooker/models/user_test.rb
|
158
|
+
- test/facebooker/rails/publisher_test.rb
|
159
|
+
- test/facebooker/rails_integration_test.rb
|
160
|
+
- test/facebooker/server_cache_test.rb
|
161
|
+
- test/facebooker/session_test.rb
|
146
162
|
- test/facebooker_test.rb
|
147
163
|
- test/fixtures/multipart_post_body_with_only_parameters.txt
|
148
164
|
- test/fixtures/multipart_post_body_with_single_file.txt
|
149
165
|
- test/fixtures/multipart_post_body_with_single_file_that_has_nil_key.txt
|
150
|
-
- test/http_multipart_post_test.rb
|
151
|
-
- test/
|
152
|
-
- test/model_test.rb
|
153
|
-
- test/publisher_test.rb
|
154
|
-
- test/rails_integration_test.rb
|
155
|
-
- test/session_test.rb
|
166
|
+
- test/net/http_multipart_post_test.rb
|
167
|
+
- test/rails_test_helper.rb
|
156
168
|
- test/test_helper.rb
|
157
|
-
- test/user_test.rb
|
158
169
|
has_rdoc: true
|
159
170
|
homepage:
|
160
171
|
post_install_message:
|
@@ -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
|