Updates test data for version and news webhook payload tests (#29664).

git-svn-id: https://svn.redmine.org/redmine/trunk@24206 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu
2025-12-08 08:36:08 +00:00
parent fffed57cd7
commit 785eb325cb

View File

@@ -127,7 +127,8 @@ class WebhookPayloadTest < ActiveSupport::TestCase
end
test "news created payload should contain news details" do
news = News.generate!
news = News.new(project: Project.first, author: @dlopper, title: "Webhook title", description: "Webhook description")
news.save!
p = WebhookPayload.new('news.created', news, @dlopper)
assert h = p.to_h
@@ -154,7 +155,7 @@ class WebhookPayloadTest < ActiveSupport::TestCase
p = WebhookPayload.new('news.deleted', news, @dlopper)
h = p.to_h
assert_equal 'news.deleted', h[:type]
assert_equal 'Updated title', h.dig(:data, :news, :title)
assert_equal 'eCookbook first release !', h.dig(:data, :news, :title)
end
test "version created payload should contain version details" do
@@ -185,6 +186,6 @@ class WebhookPayloadTest < ActiveSupport::TestCase
p = WebhookPayload.new('version.deleted', version, @dlopper)
h = p.to_h
assert_equal 'version.deleted', h[:type]
assert_equal 'Updated name', h.dig(:data, :version, :name)
assert_equal '0.1', h.dig(:data, :version, :name)
end
end