Merge pull request #4616 from tgxworld/fix_safe_mode_redirect

FIX: Incorrect path for redirect.
This commit is contained in:
Guo Xiang Tan 2016-12-19 19:02:39 +08:00 committed by GitHub
commit 5058911a7b
2 changed files with 14 additions and 1 deletions

View File

@ -14,7 +14,7 @@ class SafeModeController < ApplicationController
if safe_mode.length > 0
redirect_to path("/?safe_mode=#{safe_mode.join("%2C")}")
else
redirect_to :index
redirect_to safe_mode_path
end
end
end

View File

@ -0,0 +1,13 @@
require 'rails_helper'
RSpec.describe 'Safe mode' do
describe 'entering safe mode' do
context 'when no params are given' do
it 'should redirect back to safe mode page' do
post '/safe-mode'
expect(response.status).to redirect_to(safe_mode_path)
end
end
end
end