Commit 912d7f7b authored by James Lopez's avatar James Lopez

Fix issues importing services via Import/Export

parent 4be63f5b
...@@ -45,6 +45,7 @@ v 8.13.0 (unreleased) ...@@ -45,6 +45,7 @@ v 8.13.0 (unreleased)
- Changed Slack service user referencing from full name to username (Sebastian Poxhofer) - Changed Slack service user referencing from full name to username (Sebastian Poxhofer)
v 8.12.4 (unreleased) 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) - Fix "Copy to clipboard" tooltip to say "Copied!" when clipboard button is clicked. (lukehowell)
v 8.12.3 v 8.12.3
......
...@@ -136,6 +136,7 @@ class Service < ActiveRecord::Base ...@@ -136,6 +136,7 @@ class Service < ActiveRecord::Base
end end
def #{arg}=(value) def #{arg}=(value)
self.properties ||= {}
updated_properties['#{arg}'] = #{arg} unless #{arg}_changed? updated_properties['#{arg}'] = #{arg} unless #{arg}_changed?
self.properties['#{arg}'] = value self.properties['#{arg}'] = value
end end
......
...@@ -203,6 +203,23 @@ describe Service, models: true do ...@@ -203,6 +203,23 @@ describe Service, models: true do
end end
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 describe "callbacks" do
let(:project) { create(:project) } let(:project) { create(:project) }
let!(:service) do let!(:service) do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment