From d7eb4c9cf71490900e5f78862d9d47d64bc2c621 Mon Sep 17 00:00:00 2001 From: echarp Date: Thu, 1 Mar 2018 20:42:14 +0100 Subject: [PATCH] Go from organisation edition back to organisation consultation --- app/controllers/orgas_controller.rb | 2 +- test/controllers/orgas_controller_test.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/orgas_controller.rb b/app/controllers/orgas_controller.rb index ca1b6550..3dfba96d 100644 --- a/app/controllers/orgas_controller.rb +++ b/app/controllers/orgas_controller.rb @@ -26,7 +26,7 @@ class OrgasController < ApplicationController @orga = Orga.new orga_params respond_to do |format| if @orga.save - format.html { redirect_to :root, notice: t('.ok') } + format.html { redirect_to @orga, notice: t('.ok') } # 201 means :created format.json { render action: 'show', status: 201, location: @orga } else diff --git a/test/controllers/orgas_controller_test.rb b/test/controllers/orgas_controller_test.rb index fb26b13f..8b25f1dc 100644 --- a/test/controllers/orgas_controller_test.rb +++ b/test/controllers/orgas_controller_test.rb @@ -37,7 +37,7 @@ class OrgasControllerTest < ActionDispatch::IntegrationTest } end - assert_redirected_to :root + assert_redirected_to assigns(:orga) end test 'should create minimalist orga' do @@ -53,7 +53,7 @@ class OrgasControllerTest < ActionDispatch::IntegrationTest } end - assert_redirected_to :root + assert_redirected_to assigns(:orga) end test 'should not create orga' do