From 02194838dd64558cd974e68cb0bf800dffd25c91 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 16 Jan 2018 20:20:15 +0100 Subject: HTML e-mails for NotificationMailer (#6263) * HTML e-mails for NotificationMailer (except digest) * Add HTML template for digest * Fix build --- spec/mailers/previews/notification_mailer_preview.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec') diff --git a/spec/mailers/previews/notification_mailer_preview.rb b/spec/mailers/previews/notification_mailer_preview.rb index 99495d862..e31445c36 100644 --- a/spec/mailers/previews/notification_mailer_preview.rb +++ b/spec/mailers/previews/notification_mailer_preview.rb @@ -13,6 +13,12 @@ class NotificationMailerPreview < ActionMailer::Preview NotificationMailer.follow(f.target_account, Notification.find_by(activity: f)) end + # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/follow_request + def follow_request + f = Follow.last + NotificationMailer.follow_request(f.target_account, Notification.find_by(activity: f)) + end + # Preview this email at http://localhost:3000/rails/mailers/notification_mailer/favourite def favourite f = Favourite.last -- cgit From ea75ae2d1fd987075f600fca66003e2f69cc6cca Mon Sep 17 00:00:00 2001 From: Mike Burns Date: Wed, 17 Jan 2018 06:45:09 -0500 Subject: Use be_within instead of eq for a to_f test match (#6275) Floating point values are notoriously hard to pin down, so use the `be_within` matcher to verify the approximate value. --- spec/services/precompute_feed_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/services/precompute_feed_service_spec.rb b/spec/services/precompute_feed_service_spec.rb index d1ef6c184..396a3c3fb 100644 --- a/spec/services/precompute_feed_service_spec.rb +++ b/spec/services/precompute_feed_service_spec.rb @@ -16,7 +16,7 @@ RSpec.describe PrecomputeFeedService do subject.call(account) - expect(Redis.current.zscore(FeedManager.instance.key(:home, account.id), reblog.id)).to eq status.id.to_f + expect(Redis.current.zscore(FeedManager.instance.key(:home, account.id), reblog.id)).to be_within(0.1).of(status.id.to_f) end it 'does not raise an error even if it could not find any status' do -- cgit