|
183 | 183 | end |
184 | 184 | end |
185 | 185 |
|
186 | | - describe '#typecast helper method' do |
| 186 | + describe '#type_cast helper method' do |
187 | 187 | let(:view) { double('view', params: sample_params) } |
188 | 188 | let(:column) { ComplexDatatable.new(view).datatable.columns.first } |
189 | 189 |
|
190 | 190 | it 'returns VARCHAR if :db_adapter is :pg' do |
191 | 191 | allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :pg } |
192 | | - expect(column.send(:typecast)).to eq('VARCHAR') |
| 192 | + expect(column.send(:type_cast)).to eq('VARCHAR') |
193 | 193 | end |
194 | 194 |
|
195 | 195 | it 'returns VARCHAR if :db_adapter is :postgre' do |
196 | 196 | allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :postgre } |
197 | | - expect(column.send(:typecast)).to eq('VARCHAR') |
| 197 | + expect(column.send(:type_cast)).to eq('VARCHAR') |
198 | 198 | end |
199 | 199 |
|
200 | 200 | it 'returns VARCHAR if :db_adapter is :postgresql' do |
201 | 201 | allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :postgresql } |
202 | | - expect(column.send(:typecast)).to eq('VARCHAR') |
| 202 | + expect(column.send(:type_cast)).to eq('VARCHAR') |
203 | 203 | end |
204 | 204 |
|
205 | 205 | it 'returns VARCHAR if :db_adapter is :oracle' do |
206 | 206 | allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :oracle } |
207 | | - expect(column.send(:typecast)).to eq('VARCHAR2(4000)') |
| 207 | + expect(column.send(:type_cast)).to eq('VARCHAR2(4000)') |
208 | 208 | end |
209 | 209 |
|
210 | 210 | it 'returns VARCHAR if :db_adapter is :oracleenhanced' do |
211 | 211 | allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :oracleenhanced } |
212 | | - expect(column.send(:typecast)).to eq('VARCHAR2(4000)') |
| 212 | + expect(column.send(:type_cast)).to eq('VARCHAR2(4000)') |
213 | 213 | end |
214 | 214 |
|
215 | 215 | it 'returns CHAR if :db_adapter is :mysql2' do |
216 | 216 | allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :mysql2 } |
217 | | - expect(column.send(:typecast)).to eq('CHAR') |
| 217 | + expect(column.send(:type_cast)).to eq('CHAR') |
218 | 218 | end |
219 | 219 |
|
220 | 220 | it 'returns CHAR if :db_adapter is :mysql' do |
221 | 221 | allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :mysql } |
222 | | - expect(column.send(:typecast)).to eq('CHAR') |
| 222 | + expect(column.send(:type_cast)).to eq('CHAR') |
223 | 223 | end |
224 | 224 |
|
225 | 225 | it 'returns TEXT if :db_adapter is :sqlite' do |
226 | 226 | allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :sqlite } |
227 | | - expect(column.send(:typecast)).to eq('TEXT') |
| 227 | + expect(column.send(:type_cast)).to eq('TEXT') |
228 | 228 | end |
229 | 229 |
|
230 | 230 | it 'returns TEXT if :db_adapter is :sqlite3' do |
231 | 231 | allow_any_instance_of(AjaxDatatablesRails::Configuration).to receive(:db_adapter) { :sqlite3 } |
232 | | - expect(column.send(:typecast)).to eq('TEXT') |
| 232 | + expect(column.send(:type_cast)).to eq('TEXT') |
233 | 233 | end |
234 | 234 | end |
235 | 235 |
|
|
0 commit comments