Rails5: fix can't quote ActiveSupport::HashWithIndifferentAccess

This commit is contained in:
Jasper Maes 2018-08-27 19:54:34 +02:00
parent 881ba3f597
commit 83739b8b43
2 changed files with 7 additions and 2 deletions

View file

@ -0,0 +1,5 @@
---
title: 'Rails5: fix can''t quote ActiveSupport::HashWithIndifferentAccess'
merge_request: 21397
author: Jasper Maes
type: other

View file

@ -11,7 +11,7 @@ describe Gitlab::Import::MergeRequestCreator do
context 'merge request already exists' do context 'merge request already exists' do
let(:merge_request) { create(:merge_request, target_project: project, source_project: project) } let(:merge_request) { create(:merge_request, target_project: project, source_project: project) }
let(:commits) { merge_request.merge_request_diffs.first.commits } 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 it 'updates the data' do
commits_count = commits.count commits_count = commits.count
@ -28,7 +28,7 @@ describe Gitlab::Import::MergeRequestCreator do
context 'new merge request' do context 'new merge request' do
let(:merge_request) { build(:merge_request, target_project: project, source_project: project) } 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 it 'creates a new merge request' do
attributes.delete(:id) attributes.delete(:id)