From 83739b8b4303449ee810993b484bff382c378cba Mon Sep 17 00:00:00 2001 From: Jasper Maes Date: Mon, 27 Aug 2018 19:54:34 +0200 Subject: [PATCH] Rails5: fix can't quote ActiveSupport::HashWithIndifferentAccess --- .../unreleased/rails5-fix-import-merge-request-creator.yml | 5 +++++ spec/lib/gitlab/import/merge_request_creator_spec.rb | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/rails5-fix-import-merge-request-creator.yml diff --git a/changelogs/unreleased/rails5-fix-import-merge-request-creator.yml b/changelogs/unreleased/rails5-fix-import-merge-request-creator.yml new file mode 100644 index 00000000000..661bd748333 --- /dev/null +++ b/changelogs/unreleased/rails5-fix-import-merge-request-creator.yml @@ -0,0 +1,5 @@ +--- +title: 'Rails5: fix can''t quote ActiveSupport::HashWithIndifferentAccess' +merge_request: 21397 +author: Jasper Maes +type: other diff --git a/spec/lib/gitlab/import/merge_request_creator_spec.rb b/spec/lib/gitlab/import/merge_request_creator_spec.rb index cd3359da341..7c73e9b39f7 100644 --- a/spec/lib/gitlab/import/merge_request_creator_spec.rb +++ b/spec/lib/gitlab/import/merge_request_creator_spec.rb @@ -11,7 +11,7 @@ describe Gitlab::Import::MergeRequestCreator do context 'merge request already exists' do let(:merge_request) { create(:merge_request, target_project: project, source_project: project) } let(:commits) { merge_request.merge_request_diffs.first.commits } - let(:attributes) { HashWithIndifferentAccess.new(merge_request.attributes) } + let(:attributes) { HashWithIndifferentAccess.new(merge_request.attributes.except("merge_params")) } it 'updates the data' do commits_count = commits.count @@ -28,7 +28,7 @@ describe Gitlab::Import::MergeRequestCreator do context 'new merge request' do let(:merge_request) { build(:merge_request, target_project: project, source_project: project) } - let(:attributes) { HashWithIndifferentAccess.new(merge_request.attributes) } + let(:attributes) { HashWithIndifferentAccess.new(merge_request.attributes.except("merge_params")) } it 'creates a new merge request' do attributes.delete(:id)