comma 4.4.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +48 -0
  3. data/.rubocop.yml +3 -1
  4. data/.rubocop_todo.yml +40 -2
  5. data/.travis.yml +12 -1
  6. data/Appraisals +27 -8
  7. data/Gemfile +1 -1
  8. data/Gemfile.lock +34 -33
  9. data/README.md +2 -2
  10. data/comma.gemspec +2 -1
  11. data/gemfiles/{active5.1.7.gemfile → active5.2.5.gemfile} +3 -3
  12. data/gemfiles/{active5.2.4.3.gemfile.lock → active5.2.5.gemfile.lock} +44 -39
  13. data/gemfiles/{active5.2.4.3.gemfile → active6.0.3.6.gemfile} +3 -3
  14. data/gemfiles/{active6.0.3.1.gemfile.lock → active6.0.3.6.gemfile.lock} +44 -39
  15. data/gemfiles/{active6.0.3.1.gemfile → active6.1.3.1.gemfile} +3 -3
  16. data/gemfiles/{active5.0.7.2.gemfile.lock → active6.1.3.1.gemfile.lock} +50 -46
  17. data/gemfiles/active7.0.0.gemfile +12 -0
  18. data/gemfiles/{active5.1.7.gemfile.lock → active7.0.0.gemfile.lock} +47 -45
  19. data/gemfiles/{rails5.1.7.gemfile → rails5.2.5.gemfile} +2 -2
  20. data/gemfiles/{rails5.2.4.3.gemfile.lock → rails5.2.5.gemfile.lock} +90 -85
  21. data/gemfiles/{rails6.0.3.1.gemfile → rails6.0.3.6.gemfile} +2 -2
  22. data/gemfiles/{rails6.0.3.1.gemfile.lock → rails6.0.3.6.gemfile.lock} +106 -101
  23. data/gemfiles/rails6.1.3.1.gemfile +13 -0
  24. data/gemfiles/rails6.1.3.1.gemfile.lock +235 -0
  25. data/gemfiles/rails7.0.0.gemfile +12 -0
  26. data/gemfiles/rails7.0.0.gemfile.lock +224 -0
  27. data/lib/comma/mongoid.rb +2 -1
  28. data/lib/comma/version.rb +1 -1
  29. data/spec/controllers/users_controller_spec.rb +10 -10
  30. data/spec/rails_app/active_record/models.rb +1 -8
  31. metadata +35 -41
  32. data/gemfiles/active5.0.7.2.gemfile +0 -12
  33. data/gemfiles/rails5.0.7.2.gemfile +0 -14
  34. data/gemfiles/rails5.0.7.2.gemfile.lock +0 -204
  35. data/gemfiles/rails5.1.7.gemfile.lock +0 -204
  36. data/gemfiles/rails5.2.4.3.gemfile +0 -14
@@ -0,0 +1,235 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ comma (4.7.0)
5
+ activesupport (>= 4.2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (6.1.3.1)
11
+ actionpack (= 6.1.3.1)
12
+ activesupport (= 6.1.3.1)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (6.1.3.1)
16
+ actionpack (= 6.1.3.1)
17
+ activejob (= 6.1.3.1)
18
+ activerecord (= 6.1.3.1)
19
+ activestorage (= 6.1.3.1)
20
+ activesupport (= 6.1.3.1)
21
+ mail (>= 2.7.1)
22
+ actionmailer (6.1.3.1)
23
+ actionpack (= 6.1.3.1)
24
+ actionview (= 6.1.3.1)
25
+ activejob (= 6.1.3.1)
26
+ activesupport (= 6.1.3.1)
27
+ mail (~> 2.5, >= 2.5.4)
28
+ rails-dom-testing (~> 2.0)
29
+ actionpack (6.1.3.1)
30
+ actionview (= 6.1.3.1)
31
+ activesupport (= 6.1.3.1)
32
+ rack (~> 2.0, >= 2.0.9)
33
+ rack-test (>= 0.6.3)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
+ actiontext (6.1.3.1)
37
+ actionpack (= 6.1.3.1)
38
+ activerecord (= 6.1.3.1)
39
+ activestorage (= 6.1.3.1)
40
+ activesupport (= 6.1.3.1)
41
+ nokogiri (>= 1.8.5)
42
+ actionview (6.1.3.1)
43
+ activesupport (= 6.1.3.1)
44
+ builder (~> 3.1)
45
+ erubi (~> 1.4)
46
+ rails-dom-testing (~> 2.0)
47
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
+ activejob (6.1.3.1)
49
+ activesupport (= 6.1.3.1)
50
+ globalid (>= 0.3.6)
51
+ activemodel (6.1.3.1)
52
+ activesupport (= 6.1.3.1)
53
+ activerecord (6.1.3.1)
54
+ activemodel (= 6.1.3.1)
55
+ activesupport (= 6.1.3.1)
56
+ activestorage (6.1.3.1)
57
+ actionpack (= 6.1.3.1)
58
+ activejob (= 6.1.3.1)
59
+ activerecord (= 6.1.3.1)
60
+ activesupport (= 6.1.3.1)
61
+ marcel (~> 1.0.0)
62
+ mini_mime (~> 1.0.2)
63
+ activesupport (6.1.3.1)
64
+ concurrent-ruby (~> 1.0, >= 1.0.2)
65
+ i18n (>= 1.6, < 2)
66
+ minitest (>= 5.1)
67
+ tzinfo (~> 2.0)
68
+ zeitwerk (~> 2.3)
69
+ appraisal (1.0.3)
70
+ bundler
71
+ rake
72
+ thor (>= 0.14.0)
73
+ ast (2.4.2)
74
+ builder (3.2.4)
75
+ concurrent-ruby (1.1.9)
76
+ coveralls (0.8.23)
77
+ json (>= 1.8, < 3)
78
+ simplecov (~> 0.16.1)
79
+ term-ansicolor (~> 1.3)
80
+ thor (>= 0.19.4, < 2.0)
81
+ tins (~> 1.6)
82
+ crass (1.0.6)
83
+ diff-lcs (1.4.4)
84
+ docile (1.4.0)
85
+ erubi (1.10.0)
86
+ globalid (0.5.2)
87
+ activesupport (>= 5.0)
88
+ i18n (1.8.11)
89
+ concurrent-ruby (~> 1.0)
90
+ json (2.6.1)
91
+ loofah (2.12.0)
92
+ crass (~> 1.0.2)
93
+ nokogiri (>= 1.5.9)
94
+ mail (2.7.1)
95
+ mini_mime (>= 0.1.1)
96
+ marcel (1.0.2)
97
+ method_source (1.0.0)
98
+ mini_mime (1.0.3)
99
+ mini_portile2 (2.6.1)
100
+ minitest (5.14.4)
101
+ nio4r (2.5.8)
102
+ nokogiri (1.12.5)
103
+ mini_portile2 (~> 2.6.1)
104
+ racc (~> 1.4)
105
+ parallel (1.22.1)
106
+ parser (3.1.2.0)
107
+ ast (~> 2.4.1)
108
+ power_assert (2.0.1)
109
+ racc (1.6.0)
110
+ rack (2.2.3)
111
+ rack-test (1.1.0)
112
+ rack (>= 1.0, < 3)
113
+ rails (6.1.3.1)
114
+ actioncable (= 6.1.3.1)
115
+ actionmailbox (= 6.1.3.1)
116
+ actionmailer (= 6.1.3.1)
117
+ actionpack (= 6.1.3.1)
118
+ actiontext (= 6.1.3.1)
119
+ actionview (= 6.1.3.1)
120
+ activejob (= 6.1.3.1)
121
+ activemodel (= 6.1.3.1)
122
+ activerecord (= 6.1.3.1)
123
+ activestorage (= 6.1.3.1)
124
+ activesupport (= 6.1.3.1)
125
+ bundler (>= 1.15.0)
126
+ railties (= 6.1.3.1)
127
+ sprockets-rails (>= 2.0.0)
128
+ rails-dom-testing (2.0.3)
129
+ activesupport (>= 4.2.0)
130
+ nokogiri (>= 1.6)
131
+ rails-html-sanitizer (1.4.2)
132
+ loofah (~> 2.3)
133
+ railties (6.1.3.1)
134
+ actionpack (= 6.1.3.1)
135
+ activesupport (= 6.1.3.1)
136
+ method_source
137
+ rake (>= 0.8.7)
138
+ thor (~> 1.0)
139
+ rainbow (3.1.1)
140
+ rake (13.0.6)
141
+ regexp_parser (2.5.0)
142
+ rexml (3.2.5)
143
+ rspec (3.5.0)
144
+ rspec-core (~> 3.5.0)
145
+ rspec-expectations (~> 3.5.0)
146
+ rspec-mocks (~> 3.5.0)
147
+ rspec-activemodel-mocks (1.1.0)
148
+ activemodel (>= 3.0)
149
+ activesupport (>= 3.0)
150
+ rspec-mocks (>= 2.99, < 4.0)
151
+ rspec-core (3.5.4)
152
+ rspec-support (~> 3.5.0)
153
+ rspec-expectations (3.5.0)
154
+ diff-lcs (>= 1.2.0, < 2.0)
155
+ rspec-support (~> 3.5.0)
156
+ rspec-its (1.3.0)
157
+ rspec-core (>= 3.0.0)
158
+ rspec-expectations (>= 3.0.0)
159
+ rspec-mocks (3.5.0)
160
+ diff-lcs (>= 1.2.0, < 2.0)
161
+ rspec-support (~> 3.5.0)
162
+ rspec-rails (3.5.2)
163
+ actionpack (>= 3.0)
164
+ activesupport (>= 3.0)
165
+ railties (>= 3.0)
166
+ rspec-core (~> 3.5.0)
167
+ rspec-expectations (~> 3.5.0)
168
+ rspec-mocks (~> 3.5.0)
169
+ rspec-support (~> 3.5.0)
170
+ rspec-support (3.5.0)
171
+ rubocop (1.0.0)
172
+ parallel (~> 1.10)
173
+ parser (>= 2.7.1.5)
174
+ rainbow (>= 2.2.2, < 4.0)
175
+ regexp_parser (>= 1.8)
176
+ rexml
177
+ rubocop-ast (>= 0.6.0)
178
+ ruby-progressbar (~> 1.7)
179
+ unicode-display_width (>= 1.4.0, < 2.0)
180
+ rubocop-ast (1.17.0)
181
+ parser (>= 3.1.1.0)
182
+ rubocop-performance (1.10.2)
183
+ rubocop (>= 0.90.0, < 2.0)
184
+ rubocop-ast (>= 0.4.0)
185
+ ruby-progressbar (1.11.0)
186
+ simplecov (0.16.1)
187
+ docile (~> 1.1)
188
+ json (>= 1.8, < 3)
189
+ simplecov-html (~> 0.10.0)
190
+ simplecov-html (0.10.2)
191
+ sprockets (4.0.2)
192
+ concurrent-ruby (~> 1.0)
193
+ rack (> 1, < 3)
194
+ sprockets-rails (3.2.2)
195
+ actionpack (>= 4.0)
196
+ activesupport (>= 4.0)
197
+ sprockets (>= 3.0.0)
198
+ sqlite3 (1.4.2)
199
+ sync (0.5.0)
200
+ term-ansicolor (1.7.1)
201
+ tins (~> 1.0)
202
+ test-unit (3.5.1)
203
+ power_assert
204
+ thor (1.1.0)
205
+ tins (1.29.1)
206
+ sync
207
+ tzinfo (2.0.4)
208
+ concurrent-ruby (~> 1.0)
209
+ unicode-display_width (1.8.0)
210
+ websocket-driver (0.7.5)
211
+ websocket-extensions (>= 0.1.0)
212
+ websocket-extensions (0.1.5)
213
+ zeitwerk (2.5.1)
214
+
215
+ PLATFORMS
216
+ ruby
217
+
218
+ DEPENDENCIES
219
+ appraisal (~> 1.0.0)
220
+ comma!
221
+ coveralls
222
+ minitest (= 5.14.4)
223
+ rails (= 6.1.3.1)
224
+ rake (~> 13.0.1)
225
+ rspec (~> 3.5.0)
226
+ rspec-activemodel-mocks
227
+ rspec-its
228
+ rspec-rails
229
+ rubocop (~> 1.0.0)
230
+ rubocop-performance
231
+ sqlite3
232
+ test-unit
233
+
234
+ BUNDLED WITH
235
+ 2.1.4
@@ -0,0 +1,12 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "coveralls", :require => false
6
+ gem "rubocop", "~> 1.0.0", :require => false
7
+ gem "rubocop-performance", :require => false
8
+ gem "sqlite3"
9
+ gem "rails", "7.0.0"
10
+ gem "rspec-rails"
11
+
12
+ gemspec :path => "../"
@@ -0,0 +1,224 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ comma (4.7.0)
5
+ activesupport (>= 4.2.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (7.0.0)
11
+ actionpack (= 7.0.0)
12
+ activesupport (= 7.0.0)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ actionmailbox (7.0.0)
16
+ actionpack (= 7.0.0)
17
+ activejob (= 7.0.0)
18
+ activerecord (= 7.0.0)
19
+ activestorage (= 7.0.0)
20
+ activesupport (= 7.0.0)
21
+ mail (>= 2.7.1)
22
+ actionmailer (7.0.0)
23
+ actionpack (= 7.0.0)
24
+ actionview (= 7.0.0)
25
+ activejob (= 7.0.0)
26
+ activesupport (= 7.0.0)
27
+ mail (~> 2.5, >= 2.5.4)
28
+ rails-dom-testing (~> 2.0)
29
+ actionpack (7.0.0)
30
+ actionview (= 7.0.0)
31
+ activesupport (= 7.0.0)
32
+ rack (~> 2.0, >= 2.2.0)
33
+ rack-test (>= 0.6.3)
34
+ rails-dom-testing (~> 2.0)
35
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
+ actiontext (7.0.0)
37
+ actionpack (= 7.0.0)
38
+ activerecord (= 7.0.0)
39
+ activestorage (= 7.0.0)
40
+ activesupport (= 7.0.0)
41
+ globalid (>= 0.6.0)
42
+ nokogiri (>= 1.8.5)
43
+ actionview (7.0.0)
44
+ activesupport (= 7.0.0)
45
+ builder (~> 3.1)
46
+ erubi (~> 1.4)
47
+ rails-dom-testing (~> 2.0)
48
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
+ activejob (7.0.0)
50
+ activesupport (= 7.0.0)
51
+ globalid (>= 0.3.6)
52
+ activemodel (7.0.0)
53
+ activesupport (= 7.0.0)
54
+ activerecord (7.0.0)
55
+ activemodel (= 7.0.0)
56
+ activesupport (= 7.0.0)
57
+ activestorage (7.0.0)
58
+ actionpack (= 7.0.0)
59
+ activejob (= 7.0.0)
60
+ activerecord (= 7.0.0)
61
+ activesupport (= 7.0.0)
62
+ marcel (~> 1.0)
63
+ mini_mime (>= 1.1.0)
64
+ activesupport (7.0.0)
65
+ concurrent-ruby (~> 1.0, >= 1.0.2)
66
+ i18n (>= 1.6, < 2)
67
+ minitest (>= 5.1)
68
+ tzinfo (~> 2.0)
69
+ appraisal (1.0.3)
70
+ bundler
71
+ rake
72
+ thor (>= 0.14.0)
73
+ ast (2.4.2)
74
+ builder (3.2.4)
75
+ concurrent-ruby (1.1.9)
76
+ coveralls (0.8.23)
77
+ json (>= 1.8, < 3)
78
+ simplecov (~> 0.16.1)
79
+ term-ansicolor (~> 1.3)
80
+ thor (>= 0.19.4, < 2.0)
81
+ tins (~> 1.6)
82
+ crass (1.0.6)
83
+ diff-lcs (1.4.4)
84
+ docile (1.4.0)
85
+ erubi (1.10.0)
86
+ globalid (1.0.0)
87
+ activesupport (>= 5.0)
88
+ i18n (1.8.11)
89
+ concurrent-ruby (~> 1.0)
90
+ json (2.6.1)
91
+ loofah (2.13.0)
92
+ crass (~> 1.0.2)
93
+ nokogiri (>= 1.5.9)
94
+ mail (2.7.1)
95
+ mini_mime (>= 0.1.1)
96
+ marcel (1.0.2)
97
+ method_source (1.0.0)
98
+ mini_mime (1.1.2)
99
+ mini_portile2 (2.6.1)
100
+ minitest (5.14.4)
101
+ nio4r (2.5.8)
102
+ nokogiri (1.12.5)
103
+ mini_portile2 (~> 2.6.1)
104
+ racc (~> 1.4)
105
+ parallel (1.22.1)
106
+ parser (3.1.2.0)
107
+ ast (~> 2.4.1)
108
+ racc (1.6.0)
109
+ rack (2.2.3)
110
+ rack-test (1.1.0)
111
+ rack (>= 1.0, < 3)
112
+ rails (7.0.0)
113
+ actioncable (= 7.0.0)
114
+ actionmailbox (= 7.0.0)
115
+ actionmailer (= 7.0.0)
116
+ actionpack (= 7.0.0)
117
+ actiontext (= 7.0.0)
118
+ actionview (= 7.0.0)
119
+ activejob (= 7.0.0)
120
+ activemodel (= 7.0.0)
121
+ activerecord (= 7.0.0)
122
+ activestorage (= 7.0.0)
123
+ activesupport (= 7.0.0)
124
+ bundler (>= 1.15.0)
125
+ railties (= 7.0.0)
126
+ rails-dom-testing (2.0.3)
127
+ activesupport (>= 4.2.0)
128
+ nokogiri (>= 1.6)
129
+ rails-html-sanitizer (1.4.2)
130
+ loofah (~> 2.3)
131
+ railties (7.0.0)
132
+ actionpack (= 7.0.0)
133
+ activesupport (= 7.0.0)
134
+ method_source
135
+ rake (>= 12.2)
136
+ thor (~> 1.0)
137
+ zeitwerk (~> 2.5)
138
+ rainbow (3.1.1)
139
+ rake (13.0.6)
140
+ regexp_parser (2.5.0)
141
+ rexml (3.2.5)
142
+ rspec (3.5.0)
143
+ rspec-core (~> 3.5.0)
144
+ rspec-expectations (~> 3.5.0)
145
+ rspec-mocks (~> 3.5.0)
146
+ rspec-activemodel-mocks (1.1.0)
147
+ activemodel (>= 3.0)
148
+ activesupport (>= 3.0)
149
+ rspec-mocks (>= 2.99, < 4.0)
150
+ rspec-core (3.5.4)
151
+ rspec-support (~> 3.5.0)
152
+ rspec-expectations (3.5.0)
153
+ diff-lcs (>= 1.2.0, < 2.0)
154
+ rspec-support (~> 3.5.0)
155
+ rspec-its (1.3.0)
156
+ rspec-core (>= 3.0.0)
157
+ rspec-expectations (>= 3.0.0)
158
+ rspec-mocks (3.5.0)
159
+ diff-lcs (>= 1.2.0, < 2.0)
160
+ rspec-support (~> 3.5.0)
161
+ rspec-rails (3.5.2)
162
+ actionpack (>= 3.0)
163
+ activesupport (>= 3.0)
164
+ railties (>= 3.0)
165
+ rspec-core (~> 3.5.0)
166
+ rspec-expectations (~> 3.5.0)
167
+ rspec-mocks (~> 3.5.0)
168
+ rspec-support (~> 3.5.0)
169
+ rspec-support (3.5.0)
170
+ rubocop (1.0.0)
171
+ parallel (~> 1.10)
172
+ parser (>= 2.7.1.5)
173
+ rainbow (>= 2.2.2, < 4.0)
174
+ regexp_parser (>= 1.8)
175
+ rexml
176
+ rubocop-ast (>= 0.6.0)
177
+ ruby-progressbar (~> 1.7)
178
+ unicode-display_width (>= 1.4.0, < 2.0)
179
+ rubocop-ast (1.19.1)
180
+ parser (>= 3.1.1.0)
181
+ rubocop-performance (1.10.2)
182
+ rubocop (>= 0.90.0, < 2.0)
183
+ rubocop-ast (>= 0.4.0)
184
+ ruby-progressbar (1.11.0)
185
+ simplecov (0.16.1)
186
+ docile (~> 1.1)
187
+ json (>= 1.8, < 3)
188
+ simplecov-html (~> 0.10.0)
189
+ simplecov-html (0.10.2)
190
+ sqlite3 (1.4.2)
191
+ sync (0.5.0)
192
+ term-ansicolor (1.7.1)
193
+ tins (~> 1.0)
194
+ thor (1.1.0)
195
+ tins (1.29.1)
196
+ sync
197
+ tzinfo (2.0.4)
198
+ concurrent-ruby (~> 1.0)
199
+ unicode-display_width (1.8.0)
200
+ websocket-driver (0.7.5)
201
+ websocket-extensions (>= 0.1.0)
202
+ websocket-extensions (0.1.5)
203
+ zeitwerk (2.5.1)
204
+
205
+ PLATFORMS
206
+ ruby
207
+
208
+ DEPENDENCIES
209
+ appraisal (~> 1.0.0)
210
+ comma!
211
+ coveralls
212
+ minitest (= 5.14.4)
213
+ rails (= 7.0.0)
214
+ rake (~> 13.0.1)
215
+ rspec (~> 3.5.0)
216
+ rspec-activemodel-mocks
217
+ rspec-its
218
+ rspec-rails
219
+ rubocop (~> 1.0.0)
220
+ rubocop-performance
221
+ sqlite3
222
+
223
+ BUNDLED WITH
224
+ 2.1.4
data/lib/comma/mongoid.rb CHANGED
@@ -11,5 +11,6 @@ begin
11
11
  end
12
12
  end
13
13
  end
14
- rescue LoadError # rubocop:disable Lint/HandleExceptions
14
+ rescue LoadError => e
15
+ warn e.inspect
15
16
  end
data/lib/comma/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Comma
4
- VERSION = '4.4.0'
4
+ VERSION = '4.7.0'
5
5
  end
@@ -26,7 +26,7 @@ if defined?(Rails)
26
26
  get :index
27
27
 
28
28
  expect(response.status).to eq 200
29
- expect(response.content_type).to eq 'text/html'
29
+ expect(response.media_type).to eq 'text/html'
30
30
  expect(response.body).to eq 'Users!'
31
31
  end
32
32
 
@@ -34,7 +34,7 @@ if defined?(Rails)
34
34
  get :index, format: :csv
35
35
 
36
36
  expect(response.status).to eq 200
37
- expect(response.content_type).to eq 'text/csv'
37
+ expect(response.media_type).to eq 'text/csv'
38
38
  expect(response.header['Content-Disposition']).to include('filename="data.csv"')
39
39
 
40
40
  expected_content = <<-CSV.gsub(/^\s+/, '')
@@ -80,7 +80,7 @@ if defined?(Rails)
80
80
  get_ :with_custom_options, format: :csv, params: { custom_options: { filename: 'my_custom_name' } }
81
81
 
82
82
  expect(response.status).to eq 200
83
- expect(response.content_type).to eq 'text/csv'
83
+ expect(response.media_type).to eq 'text/csv'
84
84
  expect(response.header['Content-Disposition']).to include('filename="my_custom_name.csv"')
85
85
  end
86
86
 
@@ -90,7 +90,7 @@ if defined?(Rails)
90
90
  get_ :with_custom_options, format: :csv, params: params
91
91
 
92
92
  expect(response.status).to eq 200
93
- expect(response.content_type).to eq 'text/csv'
93
+ expect(response.media_type).to eq 'text/csv'
94
94
  expect(response.header['Content-Disposition']).to include('filename="filename with a lot of spaces.csv"')
95
95
 
96
96
  filename_string = response.header['Content-Disposition'].split('=').last
@@ -102,14 +102,14 @@ if defined?(Rails)
102
102
  get_ :with_custom_options, format: :csv, params: { custom_options: { extension: :txt } }
103
103
 
104
104
  expect(response.status).to eq 200
105
- expect(response.content_type).to eq 'text/csv'
105
+ expect(response.media_type).to eq 'text/csv'
106
106
  expect(response.header['Content-Disposition']).to include('filename="data.txt"')
107
107
  end
108
108
 
109
109
  it 'should allow mime type to be set' do
110
110
  get_ :with_custom_options, format: :csv, params: { custom_options: { mime_type: 'text/plain' } }
111
111
  expect(response.status).to eq 200
112
- expect(response.content_type).to eq 'text/plain'
112
+ expect(response.media_type).to eq 'text/plain'
113
113
  end
114
114
 
115
115
  it 'should allow bom to be set' do
@@ -129,7 +129,7 @@ if defined?(Rails)
129
129
  get_ :with_custom_options, format: :csv, params: { custom_options: { write_headers: 'true' } }
130
130
 
131
131
  expect(response.status).to eq 200
132
- expect(response.content_type).to eq 'text/csv'
132
+ expect(response.media_type).to eq 'text/csv'
133
133
 
134
134
  expected_content = <<-CSV.gsub(/^\s+/, '')
135
135
  First name,Last name,Name
@@ -144,7 +144,7 @@ if defined?(Rails)
144
144
  get_ :with_custom_options, format: :csv, params: { custom_options: { write_headers: false } }
145
145
 
146
146
  expect(response.status).to eq 200
147
- expect(response.content_type).to eq 'text/csv'
147
+ expect(response.media_type).to eq 'text/csv'
148
148
 
149
149
  expected_content = <<-CSV.gsub(/^\s+/, '')
150
150
  Fred,Flintstone,Fred Flintstone
@@ -159,7 +159,7 @@ if defined?(Rails)
159
159
  get_ :with_custom_options, format: :csv, params: { custom_options: { force_quotes: true } }
160
160
 
161
161
  expect(response.status).to eq 200
162
- expect(response.content_type).to eq 'text/csv'
162
+ expect(response.media_type).to eq 'text/csv'
163
163
 
164
164
  expected_content = <<-CSV.gsub(/^\s+/, '')
165
165
  "First name","Last name","Name"
@@ -182,7 +182,7 @@ if defined?(Rails)
182
182
  get_ :with_custom_options, format: :csv, params: params
183
183
 
184
184
  expect(response.status).to eq 200
185
- expect(response.content_type).to eq 'text/csv'
185
+ expect(response.media_type).to eq 'text/csv'
186
186
 
187
187
  expected_content = <<-CSV.gsub(/^\s+/, '')
188
188
  "Fred"||"Flintstone"||"Fred Flintstone"ENDOFLINE
@@ -28,14 +28,7 @@ class User < ActiveRecord::Base
28
28
  end
29
29
  end
30
30
 
31
- MIGRATION_CLASS =
32
- if Rails::VERSION::STRING =~ /^[56].*/
33
- ActiveRecord::Migration[4.2]
34
- else
35
- ActiveRecord::Migration
36
- end
37
-
38
- class CreateTables < MIGRATION_CLASS
31
+ class CreateTables < ActiveRecord::Migration[4.2]
39
32
  def self.up
40
33
  create_table :users do |t|
41
34
  t.string :first_name