Rename push to process on PushTarget for clearer semantics
"Push to target" reads naturally - we push the notification to the target. "Target processes" also makes sense - the target receives and handles the notification in its own way. - Add class method PushTarget.process(notification) that instantiates and calls the instance method - Rename instance method from push to process - Add private push_to helper in Pushable for readable iteration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,7 +38,7 @@ class Notification::PushTarget::NativeTest < ActiveSupport::TestCase
|
||||
@identity.devices.create!(token: "test123", platform: "apple", name: "Test iPhone")
|
||||
|
||||
assert_native_push_delivery(count: 1) do
|
||||
Notification::PushTarget::Native.new(@notification).push
|
||||
Notification::PushTarget::Native.new(@notification).process
|
||||
end
|
||||
end
|
||||
|
||||
@@ -46,7 +46,7 @@ class Notification::PushTarget::NativeTest < ActiveSupport::TestCase
|
||||
@identity.devices.delete_all
|
||||
|
||||
assert_no_native_push_delivery do
|
||||
Notification::PushTarget::Native.new(@notification).push
|
||||
Notification::PushTarget::Native.new(@notification).process
|
||||
end
|
||||
end
|
||||
|
||||
@@ -56,7 +56,7 @@ class Notification::PushTarget::NativeTest < ActiveSupport::TestCase
|
||||
@notification.update!(creator: users(:system))
|
||||
|
||||
assert_no_native_push_delivery do
|
||||
Notification::PushTarget::Native.new(@notification).push
|
||||
Notification::PushTarget::Native.new(@notification).process
|
||||
end
|
||||
end
|
||||
|
||||
@@ -67,7 +67,7 @@ class Notification::PushTarget::NativeTest < ActiveSupport::TestCase
|
||||
@identity.devices.create!(token: "token2", platform: "google", name: "Pixel")
|
||||
|
||||
assert_native_push_delivery(count: 2) do
|
||||
Notification::PushTarget::Native.new(@notification).push
|
||||
Notification::PushTarget::Native.new(@notification).process
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user