foreman_webhooks 5.0.2 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 25c2a83a7c2015b3e3d0b184beb4ce534c27bbe90cbd9fb301d138d7e183e5c5
|
|
4
|
+
data.tar.gz: b0a16fa70ffde8610190a3c0718046d4c0dedf25633a21bfb5ba341efde778ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce79fa03fd4dccce1a495510bbeded83546b3330dde622fa5b4d03ef61d8eb1f0d752c72257ab36f6fcc28cf7b1c8164fb500c764914d6f06d0712ce756c38cb
|
|
7
|
+
data.tar.gz: 5a949f01600d04a667e710107e2275f58e104ced6a5317c90a21285851cb7a9e39a85770cdd34b9c6e4bed029fe9d705b4bfd31e1cd9680b1eceac1456bb6488
|
|
@@ -76,8 +76,11 @@ module Api
|
|
|
76
76
|
param :id, :identifier, required: true
|
|
77
77
|
param_group :webhook_template_clone, as: :create
|
|
78
78
|
def clone
|
|
79
|
-
|
|
79
|
+
original = @webhook_template
|
|
80
|
+
@webhook_template = original.dup
|
|
81
|
+
@webhook_template.cloned_from = original
|
|
80
82
|
@webhook_template.name = params[:webhook_template][:name]
|
|
83
|
+
@webhook_template.locked = false
|
|
81
84
|
process_response @webhook_template.save
|
|
82
85
|
end
|
|
83
86
|
|
|
@@ -168,13 +168,16 @@ class Api::V2::WebhookTemplatesControllerTest < ActionController::TestCase
|
|
|
168
168
|
end
|
|
169
169
|
|
|
170
170
|
test 'should clone template' do
|
|
171
|
-
original_webhook_template = FactoryBot.create(:webhook_template)
|
|
171
|
+
original_webhook_template = FactoryBot.create(:webhook_template, locked: true)
|
|
172
172
|
post :clone, params: { id: original_webhook_template.to_param,
|
|
173
173
|
webhook_template: { name: 'MyClone' } }
|
|
174
174
|
assert_response :success
|
|
175
175
|
template = ActiveSupport::JSON.decode(@response.body)
|
|
176
176
|
assert_equal(template['name'], 'MyClone')
|
|
177
177
|
assert_equal(template['template'], original_webhook_template.template)
|
|
178
|
+
refute_equal(template['id'], original_webhook_template.id, 'Clone ID different from original')
|
|
179
|
+
assert_equal(template['cloned_from_id'], original_webhook_template.id)
|
|
180
|
+
assert_equal(template['locked'], false)
|
|
178
181
|
refute_equal(template['id'], original_webhook_template.id)
|
|
179
182
|
end
|
|
180
183
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_webhooks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 5.0.
|
|
4
|
+
version: 5.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Timo Goebel
|
|
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
272
272
|
- !ruby/object:Gem::Version
|
|
273
273
|
version: '0'
|
|
274
274
|
requirements: []
|
|
275
|
-
rubygems_version: 4.0.
|
|
275
|
+
rubygems_version: 4.0.6
|
|
276
276
|
specification_version: 4
|
|
277
277
|
summary: Configure webhooks for Foreman.
|
|
278
278
|
test_files:
|