remotipart 1.4.2 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +35 -0
  3. data/Appraisals +25 -0
  4. data/Gemfile +13 -0
  5. data/History.rdoc +5 -0
  6. data/README.rdoc +2 -0
  7. data/Rakefile +5 -7
  8. data/gemfiles/rails_3.2.gemfile +26 -0
  9. data/gemfiles/rails_4.2.gemfile +24 -0
  10. data/gemfiles/rails_5.2.gemfile +24 -0
  11. data/gemfiles/rails_6.0.gemfile +24 -0
  12. data/lib/remotipart/rails/version.rb +2 -2
  13. data/lib/remotipart/render_overrides.rb +2 -2
  14. data/lib/remotipart/view_helper.rb +0 -9
  15. data/remotipart.gemspec +76 -4
  16. data/spec/dummy_app/.gitignore +17 -0
  17. data/spec/dummy_app/Rakefile +7 -0
  18. data/spec/dummy_app/app/assets/images/rails.png +0 -0
  19. data/spec/dummy_app/app/assets/javascripts/application.js.erb +8 -0
  20. data/spec/dummy_app/app/assets/javascripts/comments.js +28 -0
  21. data/spec/dummy_app/app/assets/stylesheets/application.css +6 -0
  22. data/spec/dummy_app/app/assets/stylesheets/scaffold.css +65 -0
  23. data/spec/dummy_app/app/controllers/application_controller.rb +3 -0
  24. data/spec/dummy_app/app/controllers/comments_controller.rb +72 -0
  25. data/spec/dummy_app/app/helpers/application_helper.rb +2 -0
  26. data/spec/dummy_app/app/helpers/comments_helper.rb +2 -0
  27. data/spec/dummy_app/app/models/comment.rb +7 -0
  28. data/spec/dummy_app/app/views/comments/_comment.html.erb +9 -0
  29. data/spec/dummy_app/app/views/comments/_form.html.erb +40 -0
  30. data/spec/dummy_app/app/views/comments/_new_comment_links.html.erb +5 -0
  31. data/spec/dummy_app/app/views/comments/create.html.erb +7 -0
  32. data/spec/dummy_app/app/views/comments/create.js.erb +20 -0
  33. data/spec/dummy_app/app/views/comments/destroy.js.erb +1 -0
  34. data/spec/dummy_app/app/views/comments/edit.html.erb +6 -0
  35. data/spec/dummy_app/app/views/comments/escape_test.html.erb +1 -0
  36. data/spec/dummy_app/app/views/comments/index.html.erb +19 -0
  37. data/spec/dummy_app/app/views/comments/new.html.erb +7 -0
  38. data/spec/dummy_app/app/views/comments/show.html.erb +15 -0
  39. data/spec/dummy_app/app/views/layouts/application.html.erb +14 -0
  40. data/spec/dummy_app/bin/bundle +3 -0
  41. data/spec/dummy_app/bin/rails +4 -0
  42. data/spec/dummy_app/bin/rake +4 -0
  43. data/spec/dummy_app/bin/setup +34 -0
  44. data/spec/dummy_app/bin/update +29 -0
  45. data/spec/dummy_app/config.ru +4 -0
  46. data/spec/dummy_app/config/application.rb +18 -0
  47. data/spec/dummy_app/config/boot.rb +3 -0
  48. data/spec/dummy_app/config/database.yml +7 -0
  49. data/spec/dummy_app/config/environment.rb +5 -0
  50. data/spec/dummy_app/config/environments/development.rb +54 -0
  51. data/spec/dummy_app/config/environments/test.rb +53 -0
  52. data/spec/dummy_app/config/initializers/secret_token.rb +3 -0
  53. data/spec/dummy_app/config/routes.rb +6 -0
  54. data/spec/dummy_app/config/secrets.yml +5 -0
  55. data/spec/dummy_app/db/migrate/20110209210252_create_comments.rb +14 -0
  56. data/spec/dummy_app/db/migrate/20110209210315_add_attachment_to_comment.rb +15 -0
  57. data/spec/dummy_app/db/migrate/20110714205346_add_other_attachment_to_comment.rb +8 -0
  58. data/spec/dummy_app/db/schema.rb +31 -0
  59. data/spec/dummy_app/db/seeds.rb +7 -0
  60. data/spec/features/comments_spec.rb +414 -0
  61. data/spec/fixtures/hi.txt +1 -0
  62. data/spec/fixtures/qr.jpg +0 -0
  63. data/spec/spec_helper.rb +40 -0
  64. data/spec/support/arel_helper.rb +15 -0
  65. data/spec/support/connection_helper.rb +12 -0
  66. data/spec/support/integration_helper.rb +28 -0
  67. data/vendor/assets/javascripts/jquery.iframe-transport.js +3 -1
  68. metadata +130 -3
@@ -0,0 +1 @@
1
+ Smile, you're on candid camera!
Binary file
@@ -0,0 +1,40 @@
1
+ # Configure Rails Envinronment
2
+ ENV['RAILS_ENV'] = 'test'
3
+ require File.expand_path('../dummy_app/config/environment', __FILE__)
4
+
5
+ require 'rspec/rails'
6
+ require 'capybara/rspec'
7
+ require 'capybara/poltergeist'
8
+ require 'database_cleaner'
9
+
10
+ Capybara.javascript_driver = :poltergeist
11
+ Capybara.server = :webrick
12
+ Capybara.default_max_wait_time = 5
13
+
14
+ # Requires supporting ruby files with custom matchers and macros, etc,
15
+ # in spec/support/ and its subdirectories.
16
+ Dir[File.expand_path('../support/**/*.rb', __FILE__)].each {|f| require f }
17
+
18
+ RSpec.configure do |config|
19
+ load "#{Rails.root.to_s}/db/schema.rb" # use db agnostic schema by default
20
+
21
+ config.mock_with :rspec
22
+ config.expect_with :rspec do |c|
23
+ c.syntax = :expect
24
+ end
25
+ config.fixture_path = File.expand_path('../fixtures', __FILE__)
26
+
27
+ config.include Rails.application.routes.url_helpers
28
+ config.include RSpec::Matchers
29
+ config.include Capybara::DSL, type: :feature
30
+ config.include IntegrationHelper, type: :feature
31
+
32
+ config.before do |example|
33
+ DatabaseCleaner.strategy = :truncation
34
+ DatabaseCleaner.start
35
+ end
36
+
37
+ config.after(:each) do
38
+ DatabaseCleaner.clean
39
+ end
40
+ end
@@ -0,0 +1,15 @@
1
+ module Arel
2
+ module Visitors
3
+ class DepthFirst < Arel::Visitors::Visitor
4
+ alias :visit_Integer :terminal
5
+ end
6
+
7
+ class Dot < Arel::Visitors::Visitor
8
+ alias :visit_Integer :visit_String
9
+ end
10
+
11
+ class ToSql < Arel::Visitors::Visitor
12
+ alias :visit_Integer :literal
13
+ end
14
+ end
15
+ end if Rails::VERSION::MAJOR == 3
@@ -0,0 +1,12 @@
1
+ class ActiveRecord::Base
2
+ mattr_accessor :shared_connection
3
+ @@shared_connection = nil
4
+
5
+ def self.connection
6
+ @@shared_connection || retrieve_connection
7
+ end
8
+ end
9
+
10
+ # Forces all threads to share the same connection. This works on
11
+ # Capybara because it starts the web server in a thread.
12
+ ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
@@ -0,0 +1,28 @@
1
+ module IntegrationHelper
2
+ # If you do something that triggers a confirm, do it inside an accept_js_confirm or reject_js_confirm block
3
+ def accept_js_confirm
4
+ page.evaluate_script 'window.original_confirm_function = window.confirm;'
5
+ page.evaluate_script 'window.confirm = function(msg) { return true; }'
6
+ yield
7
+ page.evaluate_script 'window.confirm = window.original_confirm_function;'
8
+ end
9
+
10
+ # If you do something that triggers a confirm, do it inside an accept_js_confirm or reject_js_confirm block
11
+ def reject_js_confirm
12
+ page.evaluate_script 'window.original_confirm_function = window.confirm;'
13
+ page.evaluate_script 'window.confirm = function(msg) { return false; }'
14
+ yield
15
+ page.evaluate_script 'window.confirm = window.original_confirm_function;'
16
+ end
17
+
18
+ # Test that page doesn't redirect (there is probably a much better, built-in way to
19
+ # test this, I just don't know it.
20
+ def page_should_not_redirect
21
+ path = current_path
22
+ text = "bleep bloop"
23
+ page.execute_script "var txt = document.createTextNode('#{text}');document.body.appendChild(txt);"
24
+ yield
25
+ expect(current_path).to eq path
26
+ expect(page).to have_content(text)
27
+ end
28
+ end
@@ -210,12 +210,14 @@
210
210
  status = textarea && textarea.getAttribute("data-status") || 200,
211
211
  statusText = textarea && textarea.getAttribute("data-statusText") || "OK",
212
212
  content = {
213
- html: root.innerHTML,
214
213
  text: type ?
215
214
  textarea.value :
216
215
  root ? (root.textContent || root.innerText) : null
217
216
  };
218
217
  cleanUp();
218
+ if (!jqXHR.responseText) {
219
+ jqXHR.responseText = content.text;
220
+ }
219
221
  completeCallback(status, statusText, content, type ?
220
222
  ("Content-Type: " + type) :
221
223
  null);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remotipart
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Leppert
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-25 00:00:00.000000000 Z
12
+ date: 2019-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -39,6 +39,76 @@ dependencies:
39
39
  - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: appraisal
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: jquery-rails
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: sqlite3
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: paperclip
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: remotipart
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
42
112
  description: "Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX
43
113
  style file uploads) with jquery-rails.\n This gem augments the native Rails 3
44
114
  jQuery-UJS remote form function enabling asynchronous file uploads with little to
@@ -53,6 +123,8 @@ extra_rdoc_files:
53
123
  - README.rdoc
54
124
  files:
55
125
  - ".document"
126
+ - ".travis.yml"
127
+ - Appraisals
56
128
  - CONTRIBUTING.md
57
129
  - Gemfile
58
130
  - History.rdoc
@@ -60,6 +132,10 @@ files:
60
132
  - README.rdoc
61
133
  - Rakefile
62
134
  - VERSION_COMPATIBILITY.rdoc
135
+ - gemfiles/rails_3.2.gemfile
136
+ - gemfiles/rails_4.2.gemfile
137
+ - gemfiles/rails_5.2.gemfile
138
+ - gemfiles/rails_6.0.gemfile
63
139
  - lib/generators/remotipart/install/install_generator.rb
64
140
  - lib/remotipart.rb
65
141
  - lib/remotipart/middleware.rb
@@ -71,6 +147,57 @@ files:
71
147
  - lib/remotipart/request_helper.rb
72
148
  - lib/remotipart/view_helper.rb
73
149
  - remotipart.gemspec
150
+ - spec/dummy_app/.gitignore
151
+ - spec/dummy_app/Rakefile
152
+ - spec/dummy_app/app/assets/images/rails.png
153
+ - spec/dummy_app/app/assets/javascripts/application.js.erb
154
+ - spec/dummy_app/app/assets/javascripts/comments.js
155
+ - spec/dummy_app/app/assets/stylesheets/application.css
156
+ - spec/dummy_app/app/assets/stylesheets/scaffold.css
157
+ - spec/dummy_app/app/controllers/application_controller.rb
158
+ - spec/dummy_app/app/controllers/comments_controller.rb
159
+ - spec/dummy_app/app/helpers/application_helper.rb
160
+ - spec/dummy_app/app/helpers/comments_helper.rb
161
+ - spec/dummy_app/app/models/comment.rb
162
+ - spec/dummy_app/app/views/comments/_comment.html.erb
163
+ - spec/dummy_app/app/views/comments/_form.html.erb
164
+ - spec/dummy_app/app/views/comments/_new_comment_links.html.erb
165
+ - spec/dummy_app/app/views/comments/create.html.erb
166
+ - spec/dummy_app/app/views/comments/create.js.erb
167
+ - spec/dummy_app/app/views/comments/destroy.js.erb
168
+ - spec/dummy_app/app/views/comments/edit.html.erb
169
+ - spec/dummy_app/app/views/comments/escape_test.html.erb
170
+ - spec/dummy_app/app/views/comments/index.html.erb
171
+ - spec/dummy_app/app/views/comments/new.html.erb
172
+ - spec/dummy_app/app/views/comments/show.html.erb
173
+ - spec/dummy_app/app/views/layouts/application.html.erb
174
+ - spec/dummy_app/bin/bundle
175
+ - spec/dummy_app/bin/rails
176
+ - spec/dummy_app/bin/rake
177
+ - spec/dummy_app/bin/setup
178
+ - spec/dummy_app/bin/update
179
+ - spec/dummy_app/config.ru
180
+ - spec/dummy_app/config/application.rb
181
+ - spec/dummy_app/config/boot.rb
182
+ - spec/dummy_app/config/database.yml
183
+ - spec/dummy_app/config/environment.rb
184
+ - spec/dummy_app/config/environments/development.rb
185
+ - spec/dummy_app/config/environments/test.rb
186
+ - spec/dummy_app/config/initializers/secret_token.rb
187
+ - spec/dummy_app/config/routes.rb
188
+ - spec/dummy_app/config/secrets.yml
189
+ - spec/dummy_app/db/migrate/20110209210252_create_comments.rb
190
+ - spec/dummy_app/db/migrate/20110209210315_add_attachment_to_comment.rb
191
+ - spec/dummy_app/db/migrate/20110714205346_add_other_attachment_to_comment.rb
192
+ - spec/dummy_app/db/schema.rb
193
+ - spec/dummy_app/db/seeds.rb
194
+ - spec/features/comments_spec.rb
195
+ - spec/fixtures/hi.txt
196
+ - spec/fixtures/qr.jpg
197
+ - spec/spec_helper.rb
198
+ - spec/support/arel_helper.rb
199
+ - spec/support/connection_helper.rb
200
+ - spec/support/integration_helper.rb
74
201
  - vendor/assets/javascripts/jquery.iframe-transport.js
75
202
  - vendor/assets/javascripts/jquery.remotipart.js
76
203
  homepage: http://opensource.alfajango.com/remotipart/
@@ -92,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
219
  version: '0'
93
220
  requirements: []
94
221
  rubyforge_project:
95
- rubygems_version: 2.5.2
222
+ rubygems_version: 2.7.8
96
223
  signing_key:
97
224
  specification_version: 4
98
225
  summary: Remotipart is a Ruby on Rails gem enabling remote multipart forms (AJAX style