facebook_canvas 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,12 +7,12 @@ class FacebookCanvas::IntegrationMiddlewareTest < ActionDispatch::IntegrationTes
7
7
  end
8
8
 
9
9
  test 'do not convert post' do
10
- post '/foo/create', { "utf8" => "utf" }
10
+ post '/foo/create', params: { "utf8" => "utf" }
11
11
  assert_response :success
12
12
  end
13
13
 
14
14
  test 'do not convert xhr requests' do
15
- xhr :post, '/foo/create'
15
+ post '/foo/create', xhr: true
16
16
  assert_response :success
17
17
  end
18
18
  end
@@ -0,0 +1,19 @@
1
+ module Support
2
+ module HttpMethodCompatibility
3
+ def self.included(base)
4
+ if Rails.version < '5.0.0'
5
+ base.prepend OlderRails
6
+ end
7
+ end
8
+
9
+ module OlderRails
10
+ def post(action, params: {}, xhr: false)
11
+ if xhr
12
+ xml_http_request(:post, action, params)
13
+ else
14
+ super(action, params)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -16,3 +16,5 @@ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
16
16
 
17
17
  # Load support files
18
18
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
19
+
20
+ ActionDispatch::IntegrationTest.include Support::HttpMethodCompatibility
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook_canvas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - André Stuhrmann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-06 00:00:00.000000000 Z
11
+ date: 2017-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.1
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.1
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: minitest-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -112,6 +112,7 @@ files:
112
112
  - test/fixtures/signed_request.txt
113
113
  - test/fixtures/signed_request_with_user_id.txt
114
114
  - test/integration/middleware_test.rb
115
+ - test/support/http_method_compatibility.rb
115
116
  - test/test_helper.rb
116
117
  homepage:
117
118
  licenses:
@@ -138,47 +139,48 @@ signing_key:
138
139
  specification_version: 4
139
140
  summary: Rails engine for Facebook's canvas integration.
140
141
  test_files:
141
- - test/integration/middleware_test.rb
142
- - test/facebook_canvas_test.rb
143
- - test/test_helper.rb
144
- - test/facebook_canvas/middleware_test.rb
145
142
  - test/facebook_canvas/signed_request_test.rb
146
- - test/dummy/log/test.log
147
- - test/dummy/Rakefile
148
- - test/dummy/bin/setup
149
- - test/dummy/bin/rails
150
- - test/dummy/bin/bundle
151
- - test/dummy/bin/rake
143
+ - test/facebook_canvas/middleware_test.rb
144
+ - test/facebook_canvas_test.rb
152
145
  - test/dummy/README.rdoc
153
- - test/dummy/config/environment.rb
154
- - test/dummy/config/boot.rb
155
- - test/dummy/config/secrets.yml
156
- - test/dummy/config/routes.rb
157
- - test/dummy/config/initializers/inflections.rb
158
- - test/dummy/config/initializers/filter_parameter_logging.rb
146
+ - test/dummy/app/assets/stylesheets/application.css
147
+ - test/dummy/app/assets/javascripts/application.js
148
+ - test/dummy/app/controllers/foo_controller.rb
149
+ - test/dummy/app/controllers/application_controller.rb
150
+ - test/dummy/app/views/foo/create.haml
151
+ - test/dummy/app/views/layouts/application.html.erb
152
+ - test/dummy/app/helpers/application_helper.rb
153
+ - test/dummy/config/application.rb
159
154
  - test/dummy/config/initializers/session_store.rb
155
+ - test/dummy/config/initializers/wrap_parameters.rb
156
+ - test/dummy/config/initializers/assets.rb
157
+ - test/dummy/config/initializers/filter_parameter_logging.rb
160
158
  - test/dummy/config/initializers/cookies_serializer.rb
159
+ - test/dummy/config/initializers/inflections.rb
161
160
  - test/dummy/config/initializers/backtrace_silencers.rb
162
161
  - test/dummy/config/initializers/mime_types.rb
163
- - test/dummy/config/initializers/wrap_parameters.rb
164
- - test/dummy/config/initializers/assets.rb
165
- - test/dummy/config/database.yml
166
162
  - test/dummy/config/locales/en.yml
163
+ - test/dummy/config/routes.rb
167
164
  - test/dummy/config/environments/development.rb
168
- - test/dummy/config/environments/production.rb
169
165
  - test/dummy/config/environments/test.rb
170
- - test/dummy/config/application.rb
171
- - test/dummy/public/500.html
166
+ - test/dummy/config/environments/production.rb
167
+ - test/dummy/config/environment.rb
168
+ - test/dummy/config/database.yml
169
+ - test/dummy/config/boot.rb
170
+ - test/dummy/config/secrets.yml
171
+ - test/dummy/Rakefile
172
+ - test/dummy/public/favicon.ico
172
173
  - test/dummy/public/422.html
173
174
  - test/dummy/public/404.html
174
- - test/dummy/public/favicon.ico
175
- - test/dummy/app/views/foo/create.haml
176
- - test/dummy/app/views/layouts/application.html.erb
177
- - test/dummy/app/assets/javascripts/application.js
178
- - test/dummy/app/assets/stylesheets/application.css
179
- - test/dummy/app/controllers/application_controller.rb
180
- - test/dummy/app/controllers/foo_controller.rb
181
- - test/dummy/app/helpers/application_helper.rb
175
+ - test/dummy/public/500.html
176
+ - test/dummy/log/test.log
177
+ - test/dummy/bin/setup
178
+ - test/dummy/bin/rake
179
+ - test/dummy/bin/rails
180
+ - test/dummy/bin/bundle
182
181
  - test/dummy/config.ru
183
182
  - test/fixtures/signed_request.txt
184
183
  - test/fixtures/signed_request_with_user_id.txt
184
+ - test/test_helper.rb
185
+ - test/integration/middleware_test.rb
186
+ - test/support/http_method_compatibility.rb