From a6244ba1ab60ce142f9bdc0c897bdab0236991e3 Mon Sep 17 00:00:00 2001 From: Jason Barnabe Date: Thu, 22 Feb 2018 08:43:23 -0600 Subject: [PATCH 1/3] Fix 'render text:' deprecation --- lib/wice/wice_grid_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/wice/wice_grid_controller.rb b/lib/wice/wice_grid_controller.rb index be97efcd..d2c1b28c 100644 --- a/lib/wice/wice_grid_controller.rb +++ b/lib/wice/wice_grid_controller.rb @@ -179,7 +179,7 @@ def send_file_rails2(path, options = {}) #:nodoc: @performed_render = false logger.info "Sending file #{path}" unless logger.nil? - File.open(path, 'rb') { |file| render status: options[:status], text: file.read } + File.open(path, 'rb') { |file| render status: options[:status], plain: file.read } end DEFAULT_SEND_FILE_OPTIONS_RAILS2 = { #:nodoc: From 2b9e216a77430c9e83447b5431bae8175a6bb67f Mon Sep 17 00:00:00 2001 From: Jason Barnabe Date: Thu, 21 Jun 2018 15:59:04 -0500 Subject: [PATCH 2/3] Add working test for CSV export --- spec/features/csv_export_request_spec.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/spec/features/csv_export_request_spec.rb b/spec/features/csv_export_request_spec.rb index 808f63db..ab2e3b1e 100644 --- a/spec/features/csv_export_request_spec.rb +++ b/spec/features/csv_export_request_spec.rb @@ -7,12 +7,8 @@ end it 'should export csv' do - # no idea how to test these - - # find(:css, 'button.wg-external-csv-export-button').click - - select 'Urgent', from: 'g1_f_priority_id' - - # find(:css, 'button.div.clickable.export-to-csv-button').click + find(:css, 'button.wg-external-csv-export-button').click + sleep 1 + expect(page.body).to include('ID;Title;Priority;Status;Project Name;') end end From cc857e4260ed6bec8305ee787de4504315882fef Mon Sep 17 00:00:00 2001 From: Jason Barnabe Date: Thu, 21 Jun 2018 16:31:30 -0500 Subject: [PATCH 3/3] Add to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d8e51db..66056b96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Unreleased * Add option `filter_control_options` to columns. Initial use is to pass in the options `start_year`, `end_year`, and `max_year_allowed` when using `rails_datetime_helper` - [#12](https://github.com/patricklindsay/wice_grid/pull/18) +* Fix deprecation (in Rails 5.0.x) and incorrect behaviour (in Rails 5.1.x) of CSV exports ## 4.0.1 (31 May, 2018)