Skip to content

Commit

Permalink
Test ephemeral URL helpers and translations
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Sep 6, 2024
1 parent 02027a3 commit 9f57d03
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/ephemeral_notifier_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ class EphemeralNotifierTest < ActiveSupport::TestCase
test "ephemeral has record shortcut" do
assert_equal :foo, EphemeralNotifier.with(record: :foo).record
end

test "ephemeral notifier includes Rails urls" do
assert_equal "http://localhost:3000/", EphemeralNotifier.new.root_url
end
end
8 changes: 8 additions & 0 deletions test/models/noticed/notification_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,12 @@ class Noticed::NotificationTest < ActiveSupport::TestCase
test "unseen?" do
assert_not noticed_notifications(:one).unseen?
end

test "notification url helpers" do
assert_equal "http://localhost:3000/", CommentNotifier::Notification.new.root_url
end

test "ephemeral notification url helpers" do
assert_equal "http://localhost:3000/", EphemeralNotifier::Notification.new.root_url
end
end
8 changes: 8 additions & 0 deletions test/translation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,12 @@ def message
block = I18nExample.delivery_methods[:test].config[:message]
assert_equal "Hello world", noticed_notifications(:one).instance_exec(&block)
end

test "ephemeral translations" do
assert_equal "Hello world", EphemeralNotifier.new.t("hello")
end

test "ephemeral notification translations" do
assert_equal "Hello world", EphemeralNotifier::Notification.new.t("hello")
end
end

0 comments on commit 9f57d03

Please sign in to comment.