discourse/spec
Krzysztof Kotlarek e4d51e5b0a
FIX: correct link in the notification about moved post (#11399)
Notification is created by a job. If the job is evaluated before changes are committed to a database, a notification will have an incorrect URL.

Therefore, the job should be lodged in enqueue_jobs method which is triggered after the transaction:

```ruby
Topic.transaction do
  move_posts_to topic
end
add_allowed_users(participants) if participants.present? && @move_to_pm
enqueue_jobs(topic)
```

I improved a little bit specs to ensure that the destination topic_id is set. However, that tests are passing even without code improvements. I couldn't find an easy way to "delay" database transaction.

Meta: https://meta.discourse.org/t/bug-with-notifications-for-moved-posts/168937
2020-12-04 08:43:42 +11:00
..
components FEATURE: Non-staff users can use shared drafts. (#11329) 2020-12-03 11:07:57 -03:00
fabricators DEV: Cleanup ignored user logic (#11107) 2020-11-03 12:38:54 +00:00
fixtures Onebox improved error handling and support for Instagram Access Tokens (#11253) 2020-11-18 12:55:16 -05:00
helpers UX: Use appropriate logo on static pages (#11211) 2020-11-12 10:50:55 -08:00
import_export FEATURE: Rake task to export groups (#9450) 2020-04-17 14:59:54 -07:00
initializers FIX: We need to skip users with associated reviewables when auto-approving (#9080) 2020-03-02 14:33:52 -05:00
integration PERF: we don't need to use a huge image to test thumbnails (#11025) 2020-10-27 12:39:52 +11:00
integrity DEV: Check English locale for errors in CI 2020-06-03 21:54:58 +02:00
jobs DEV: Fix flakey spec in export_user_archive (#11278) 2020-11-18 11:12:06 -05:00
lib FIX: Do not optimize uploaded custom emoji (#11203) 2020-11-12 11:22:38 +11:00
mailers FIX: Ensure group SMTP and message builder always uses from address for Reply-To when IMAP is enabled (#11037) 2020-10-28 07:01:58 +10:00
models FIX: correct link in the notification about moved post (#11399) 2020-12-04 08:43:42 +11:00
multisite DEV: Clean up S3 specs, stubs, and helpers 2020-09-28 12:02:25 +01:00
requests FEATURE: Onebox local categories (#11311) 2020-11-25 10:53:05 +11:00
script/import_scripts FIX: improve Vanilla importing (#10478) 2020-08-24 16:19:57 -04:00
serializers FEATURE: Allow Category Group Moderators to edit topic titles (#11340) 2020-12-02 17:21:59 -05:00
services FEATURE: Implement edit functionality for post notices (#11140) 2020-11-11 14:49:53 +02:00
support FIX: Do not enable published page if secure media enabled (#11131) 2020-11-06 10:33:19 +10:00
tasks DEV: Clean up S3 specs, stubs, and helpers 2020-09-28 12:02:25 +01:00
views/omniauth_callbacks FEATURE: Use full page redirection for all external auth methods (#8092) 2019-10-08 12:10:43 +01:00
rails_helper.rb DEV: Ensure DiscourseEvent handlers cleaned up during specs (#11205) 2020-11-11 19:46:13 +00:00
swagger_helper.rb DEV: Add rswag to aid in api documention (#9546) 2020-04-27 16:40:07 -06:00