Commit Graph

23 Commits

Author SHA1 Message Date
Martin Brennan f753643cb1
FIX: Unread topics not clearing when whisper is last post (#8271)
Meta thread: https://meta.discourse.org/t/cant-dismiss-unread-if-last-post-is-an-assign-or-whisper/131823/7

* when sending a whisper, the highest_staff_post_number is set
in the next_post_number method for a Topic, but the
highest_post_number is left alone. this leaves a situation
where highest_staff_post_number is > highest_post_number
* when TopicsBulkAction#dismiss_posts was run, it was only setting the topic_user
highest_seen_post_number using the highest_post_number from the topic, so if
the user was staff and the last post in a topic was a whisper
their highest seen number was not set, and the topic stayed unread

Found through testing that the bug wasn't to do with Assign/Unassign as they do not affect the post numbers, only whispering does.
2019-11-01 09:19:43 +10:00
Krzysztof Kotlarek 427d54b2b0 DEV: Upgrading Discourse to Zeitwerk (#8098)
Zeitwerk simplifies working with dependencies in dev and makes it easier reloading class chains. 

We no longer need to use Rails "require_dependency" anywhere and instead can just use standard 
Ruby patterns to require files.

This is a far reaching change and we expect some followups here.
2019-10-02 14:01:53 +10:00
Daniel Waterworth bc4748571e Moved fabrication of topic to top level in topics_bulk_action_spec.rb 2019-05-10 08:34:04 -04:00
Daniel Waterworth e219588142 DEV: Prefabrication (test optimization) (#7414)
* Introduced fab!, a helper that creates database state for a group

It's almost identical to let_it_be, except:

 1. It creates a new object for each test by default,
 2. You can disable it using PREFABRICATION=0
2019-05-07 13:12:20 +10:00
Sam Saffron 4ea21fa2d0 DEV: use #frozen_string_literal: true on all spec
This change both speeds up specs (less strings to allocate) and helps catch
cases where methods in Discourse are mutating inputs.

Overall we will be migrating everything to use #frozen_string_literal: true
it will take a while, but this is the first and safest move in this direction
2019-04-30 10:27:42 +10:00
OsamaSayegh ab68379abb Use `PostDestroyer` to delete topics when performing bulk operation (#5202)
* Use `PostDestroyer` to delete topics when performing bulk operation

This PR should fix this bug: https://meta.discourse.org/t/bulk-deletion-of-topics-not-logged/50407?u=osama

* failing test
2017-09-28 14:22:49 +02:00
Régis Hanol dd1cc23caf fix randomly failing specs 2017-03-27 22:47:41 +02:00
Guo Xiang Tan b87c5eb1b6 Fix randomly failing spec. 2017-03-24 15:46:42 +08:00
Neil Lalonde 0661cebbcf fix intermittent failing spec 2017-03-07 11:59:05 -05:00
Jakub Macina 4a2f13348a ADD: Append tags bulk action for topics 2017-02-20 18:14:32 +01:00
Neil Lalonde f13470b96b Use db schema for tags instead of plugin store and custom fields 2016-05-26 14:29:48 -04:00
Andy Waite 3e50313fdc Prepare for separation of RSpec helper files
Since rspec-rails 3, the default installation creates two helper files:
* `spec_helper.rb`
* `rails_helper.rb`

`spec_helper.rb` is intended as a way of running specs that do not
require Rails, whereas `rails_helper.rb` loads Rails (as Discourse's
current `spec_helper.rb` does).

For more information:

https://www.relishapp.com/rspec/rspec-rails/docs/upgrade#default-helper-files

In this commit, I've simply replaced all instances of `spec_helper` with
`rails_helper`, and renamed the original `spec_helper.rb`.

This brings the Discourse project closer to the standard usage of RSpec
in a Rails app.

At present, every spec relies on loading Rails, but there are likely
many that don't need to. In a future pull request, I hope to introduce a
separate, minimal `spec_helper.rb` which can be used in tests which
don't rely on Rails.
2015-12-01 20:39:42 +00:00
Robin Ward 6b236d3c83 FEATURE: Bulk Unlisting of topics 2015-10-27 16:57:40 -04:00
Luciano Sousa 0fd98b56d8 few components with rspec3 syntax 2015-01-09 13:34:37 -03:00
Sam 2251877332 FIX: "Dismiss Posts" corrupting read state
REFACTOR: seen_post_count was a bad name, renamed to highest_seen_post_number
2014-10-31 09:40:35 +11:00
cpradio afdbb2bb96 FEATURE: Add Archive Topics to Bulk actions
Add the ability to archive topics in bulk
https://meta.discourse.org/t/archive-topics-via-bulk/20302
2014-09-22 14:56:48 -04:00
Robin Ward 15c7e01b90 FEATURE: Can bulk delete topics now using the modal. 2014-08-11 15:14:02 -04:00
Sam 49f738fe27 FEATURE: allow users to dismiss unread posts 2014-08-08 16:29:51 +10:00
Robin Ward fb8dda7f42 FIX: We should use `category_id` instead of `category_name` to perform
operations, now that the subcategory names are not unique.
2014-07-16 15:40:35 -04:00
Robin Ward a07e9f7e71 FEATURE: Bulk `reset read` status. 2014-02-21 15:18:45 -05:00
Robin Ward 3f3c07f136 FEATURE: Can bulk update the notification level of topics 2014-02-18 13:02:22 -05:00
Robin Ward 6f23870327 Bulk close operation 2014-01-30 12:44:40 -05:00
Robin Ward 7564d9a20c Server side implementation for bulk editing categories 2014-01-30 11:44:29 -05:00