diff --git a/.devcontainer/create-db-user.sql b/.devcontainer/create-db-user.sql new file mode 100644 index 0000000..291dfc4 --- /dev/null +++ b/.devcontainer/create-db-user.sql @@ -0,0 +1,2 @@ +CREATE USER vscode CREATEDB; +CREATE DATABASE vscode WITH OWNER vscode; diff --git a/app/controllers/code_review_controller.rb b/app/controllers/code_review_controller.rb index 3ffdf6f..3aa10be 100644 --- a/app/controllers/code_review_controller.rb +++ b/app/controllers/code_review_controller.rb @@ -114,7 +114,6 @@ def new @review.save! render partial: 'add_success', status: 200 - return else change_id = params[:change_id].to_i unless params[:change_id].blank? @review.change = Change.find(change_id) if change_id @@ -137,8 +136,8 @@ def new break end } unless @default_version_id + render partial: 'new_form', status: 200 end - render partial: 'new_form', status: 200 } rescue ActiveRecord::RecordInvalid => e logger.error e diff --git a/test/test_helper.rb b/test/test_helper.rb index 07acc79..e782758 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -15,6 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper') require 'simplecov' require 'simplecov-rcov' require 'simplecov-lcov' @@ -43,7 +44,7 @@ include ActiveSupport::Testing::FileFixtures end -require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper') + include ActionDispatch::TestProcess fixtures = []