FIX: Incorrect path for redirect.

This commit is contained in:
Guo Xiang Tan 2016-12-19 18:12:15 +08:00
parent c7289f423f
commit 18c8323987
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