Commit b8d0ba45 authored by marcheing's avatar marcheing

Redirect to root path after content creation

As the encoded content won't be created at the same time.
parent 844907d0
......@@ -23,7 +23,7 @@ class ContentsController < ApplicationController
respond_to do |format|
if @content.save
format.html { redirect_to @content, notice: I18n.t('successfully_created_video') }
format.html { redirect_to root_path, notice: I18n.t('successfully_created_video') }
else
format.html { render :new }
end
......
......@@ -86,8 +86,8 @@ RSpec.describe ContentsController, type: :controller do
post :create, params: { content: valid_request_parameters }
end
it 'redirects to the created content' do
expect(response).to redirect_to(Content.last)
it 'redirects to the home page' do
expect(response).to redirect_to(root_path)
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment