提交 912d7f7b 编写于 作者: J James Lopez

Fix issues importing services via Import/Export

上级 4be63f5b
......@@ -45,6 +45,7 @@ v 8.13.0 (unreleased)
- Changed Slack service user referencing from full name to username (Sebastian Poxhofer)
v 8.12.4 (unreleased)
- Fix issues importing services via Import/Export
- Fix "Copy to clipboard" tooltip to say "Copied!" when clipboard button is clicked. (lukehowell)
v 8.12.3
......
......@@ -136,6 +136,7 @@ class Service < ActiveRecord::Base
end
def #{arg}=(value)
self.properties ||= {}
updated_properties['#{arg}'] = #{arg} unless #{arg}_changed?
self.properties['#{arg}'] = value
end
......
......@@ -203,6 +203,23 @@ describe Service, models: true do
end
end
describe 'initialize service with no properties' do
let(:service) do
GitlabIssueTrackerService.create(
project: create(:project),
title: 'random title'
)
end
it 'does not raise error' do
expect { service }.not_to raise_error
end
it 'creates the properties' do
expect(service.properties).to eq({ "title" => "random title" })
end
end
describe "callbacks" do
let(:project) { create(:project) }
let!(:service) do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册