-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fab840a
commit ddbaf22
Showing
5 changed files
with
78 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
cache: bundler | ||
language: ruby | ||
sudo: false | ||
|
||
notifications: | ||
email: false | ||
|
||
rvm: | ||
- 2.2.5 | ||
- 2.3.1 | ||
|
||
matrix: | ||
include: | ||
- rvm: 2.3.1 | ||
env: "RAILS_VERSION=4.2.6" | ||
- rvm: 2.2.5 | ||
env: "RAILS_VERSION=5.0.0" | ||
|
||
jdk: | ||
- oraclejdk8 | ||
before_install: | ||
- gem install bundler | ||
|
||
env: | ||
global: | ||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true | ||
- "RAILS_VERSION=5.0.0" | ||
|
||
global_env: | ||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true | ||
|
||
jdk: oraclejdk8 |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Backport the Rails 5 controller test methods to Rails 4 | ||
module BackportTestHelpers | ||
def delete(*args) | ||
(action, rest) = *args | ||
rest ||= {} | ||
|
||
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr] | ||
|
||
super(action, rest[:params]) | ||
end | ||
|
||
def get(*args) | ||
(action, rest) = *args | ||
rest ||= {} | ||
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr] | ||
super(action, rest[:params]) | ||
end | ||
|
||
def post(*args) | ||
(action, rest) = *args | ||
rest ||= {} | ||
body = rest[:body] | ||
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr] | ||
|
||
if body | ||
super(action, body, rest.except(:params).merge(rest[:params])) | ||
else | ||
super(action, rest[:params]) | ||
end | ||
end | ||
|
||
def put(*args) | ||
(action, rest) = *args | ||
rest ||= {} | ||
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr] | ||
super(action, rest[:params]) | ||
end | ||
|
||
def patch(*args) | ||
(action, rest) = *args | ||
rest ||= {} | ||
@request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' if rest[:xhr] | ||
super(action, rest[:params]) | ||
end | ||
end |