File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
lib/ajax-datatables-rails
spec/ajax-datatables-rails Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -150,15 +150,15 @@ def draw_id
150150 end
151151
152152 def raw_records_error_text
153- <<- ERROR
153+ <<~ ERROR
154154
155155 You should implement this method in your class and specify
156156 how records are going to be retrieved from the database.
157157 ERROR
158158 end
159159
160160 def data_error_text
161- <<- ERROR
161+ <<~ ERROR
162162
163163 You should implement this method in your class and return an array
164164 of arrays, or an array of hashes, as defined in the jQuery.dataTables
@@ -167,7 +167,7 @@ def data_error_text
167167 end
168168
169169 def view_columns_error_text
170- <<- ERROR
170+ <<~ ERROR
171171
172172 You should implement this method in your class and return an array
173173 of database columns based on the columns displayed in the HTML view.
Original file line number Diff line number Diff line change 2020 context 'when method is not defined by the user' do
2121 it 'raises an error' do
2222 datatable = described_class . new ( sample_params )
23- expect { datatable . view_columns } . to raise_error NotImplementedError
23+ expect { datatable . view_columns } . to raise_error ( NotImplementedError ) . with_message ( <<~ERROR )
24+
25+ You should implement this method in your class and return an array
26+ of database columns based on the columns displayed in the HTML view.
27+ These columns should be represented in the ModelName.column_name,
28+ or aliased_join_table.column_name notation.
29+ ERROR
2430 end
2531 end
2632
3642 context 'when method is not defined by the user' do
3743 it 'raises an error' do
3844 datatable = described_class . new ( sample_params )
39- expect { datatable . get_raw_records } . to raise_error NotImplementedError
45+ expect { datatable . get_raw_records } . to raise_error ( NotImplementedError ) . with_message ( <<~ERROR )
46+
47+ You should implement this method in your class and specify
48+ how records are going to be retrieved from the database.
49+ ERROR
4050 end
4151 end
4252 end
4555 context 'when method is not defined by the user' do
4656 it 'raises an error' do
4757 datatable = described_class . new ( sample_params )
48- expect { datatable . data } . to raise_error NotImplementedError
58+ expect { datatable . data } . to raise_error ( NotImplementedError ) . with_message ( <<~ERROR )
59+
60+ You should implement this method in your class and return an array
61+ of arrays, or an array of hashes, as defined in the jQuery.dataTables
62+ plugin documentation.
63+ ERROR
4964 end
5065 end
5166
You can’t perform that action at this time.
0 commit comments