From d5fa8b1724ad1dc436340c42a9645fd0c42ca966 Mon Sep 17 00:00:00 2001 From: Peter Vandoros Date: Wed, 8 Aug 2018 16:16:13 +1000 Subject: [PATCH 1/3] Use 'render plain:' instead of 'render text:' 'render text:' has been deprecated in Rails 5 --- app/controllers/guide/base_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/guide/base_controller.rb b/app/controllers/guide/base_controller.rb index 51719c36..016deb5c 100644 --- a/app/controllers/guide/base_controller.rb +++ b/app/controllers/guide/base_controller.rb @@ -18,9 +18,9 @@ def handle_known_errors case error when Guide::Errors::InvalidNode, Guide::Errors::PermissionDenied - render :text => 'Nothing to see here.', :status => '404' + render :plain => 'Nothing to see here.', :status => '404' else - render :text => "Something's gone wrong. Sorry about that.", :status => '500' + render :plain => "Something's gone wrong. Sorry about that.", :status => '500' end end end From f74a8fc87e3f1b195e683751fb942b7d1bd549c9 Mon Sep 17 00:00:00 2001 From: Peter Vandoros Date: Wed, 8 Aug 2018 16:18:25 +1000 Subject: [PATCH 2/3] Bump patch version in preparation for releasing a new version --- lib/guide/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/guide/version.rb b/lib/guide/version.rb index 1b74700a..3906b9c5 100644 --- a/lib/guide/version.rb +++ b/lib/guide/version.rb @@ -1,3 +1,3 @@ module Guide - VERSION = "0.4.0" + VERSION = "0.4.1" end From 9c341b6e8f85c7cf704f29b49a55d582cb8d2b38 Mon Sep 17 00:00:00 2001 From: Peter Vandoros Date: Wed, 8 Aug 2018 20:27:36 +1000 Subject: [PATCH 3/3] Delete temporary rails 5 branching in specs --- .../controllers/guide/nodes_controller_spec.rb | 12 ++---------- .../guide/scenarios_controller_spec.rb | 18 +++--------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/spec/controllers/guide/nodes_controller_spec.rb b/spec/controllers/guide/nodes_controller_spec.rb index 0dde0eaf..d6f2f67a 100644 --- a/spec/controllers/guide/nodes_controller_spec.rb +++ b/spec/controllers/guide/nodes_controller_spec.rb @@ -48,11 +48,7 @@ end it "does not render the show template" do - if Rails.version < '5' - expect(response).not_to render_template(:show) - else - expect(response.body).to be_blank - end + expect(response).not_to render_template(:show) end end end @@ -79,11 +75,7 @@ end it "does not render the show template" do - if Rails.version < '5' - expect(response).not_to render_template(:show) - else - expect(response.body).to be_blank - end + expect(response).not_to render_template(:show) end end end diff --git a/spec/controllers/guide/scenarios_controller_spec.rb b/spec/controllers/guide/scenarios_controller_spec.rb index 8971df6c..3494790c 100644 --- a/spec/controllers/guide/scenarios_controller_spec.rb +++ b/spec/controllers/guide/scenarios_controller_spec.rb @@ -50,11 +50,7 @@ end it "does not render the show template" do - if Rails.version < '5' - expect(response).not_to render_template(:show) - else - expect(response.body).to be_blank - end + expect(response).not_to render_template(:show) end end end @@ -83,11 +79,7 @@ end it "does not render the show template" do - if Rails.version < '5' - expect(response).not_to render_template(:show) - else - expect(response.body).to be_blank - end + expect(response).not_to render_template(:show) end end end @@ -121,11 +113,7 @@ end it "does not render the show template" do - if Rails.version < '5' - expect(response).not_to render_template(:show) - else - expect(response.body).to be_blank - end + expect(response).not_to render_template(:show) end end end