Skip to content

Commit 672cccf

Browse files
committed
Move test
1 parent 578e62b commit 672cccf

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

spec/ajax-datatables-rails/extended_spec.rb

Lines changed: 0 additions & 19 deletions
This file was deleted.

spec/ajax-datatables-rails/orm/active_record_filter_records_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,4 +631,20 @@
631631
end
632632
end
633633
end
634+
635+
describe 'formatter option' do
636+
let(:datatable) { DatatableWithFormater.new(sample_params) }
637+
638+
before(:each) do
639+
create(:user, username: 'johndoe', email: 'johndoe@example.com', last_name: 'DOE')
640+
create(:user, username: 'msmith', email: 'mary.smith@example.com', last_name: 'SMITH')
641+
datatable.params[:columns]['3'][:search][:value] = 'doe'
642+
end
643+
644+
it 'can transform search value before asking the database' do
645+
expect(datatable.data.size).to eq 1
646+
item = datatable.data.first
647+
expect(item[:last_name]).to eq 'DOE'
648+
end
649+
end
634650
end

0 commit comments

Comments
 (0)