Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #85 from envato/render-plain-not-text
Browse files Browse the repository at this point in the history
Use `render plain:` instead of the deprecated `render text:`
  • Loading branch information
petervandoros authored Aug 9, 2018
2 parents 8272b18 + 9c341b6 commit 117e1f4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 28 deletions.
4 changes: 2 additions & 2 deletions app/controllers/guide/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/guide/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Guide
VERSION = "0.4.0"
VERSION = "0.4.1"
end
12 changes: 2 additions & 10 deletions spec/controllers/guide/nodes_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 3 additions & 15 deletions spec/controllers/guide/scenarios_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 117e1f4

Please sign in to comment.