File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
spec/ajax-datatables-rails Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 86
86
expect ( item [ 2 ] ) . to eq 'Name "><img src=x onerror=alert("first_name")>'
87
87
expect ( item [ 3 ] ) . to eq 'Name "><img src=x onerror=alert("last_name")>'
88
88
end
89
+
90
+ context 'with no searchable columns' do
91
+ let ( :datatable ) do
92
+ ComplexDatatableArray . new ( view ) . tap do |datatable |
93
+ datatable . instance_variable_set :@searchable_columns , [ ]
94
+ end
95
+ end
96
+
97
+ context 'when search value is comma-separated string' do
98
+ let ( :view ) { double ( 'view' , params : sample_params . merge ( search : { value : 'one, two' } ) ) }
99
+
100
+ it 'should return an array of arrays' do
101
+ create_list ( :user , 5 )
102
+ expect ( datatable . data ) . to be_a ( Array )
103
+ expect ( datatable . data . size ) . to eq 5
104
+ item = datatable . data . first
105
+ expect ( item ) . to be_a ( Array )
106
+ end
107
+ end
108
+ end
89
109
end
90
110
end
91
111
You can’t perform that action at this time.
0 commit comments