Commit Graph

12 Commits

Author SHA1 Message Date
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
Neil Lalonde 4e46d91b8d Refactor SpamRulesEnforcer so that each spam rule is in its own class 2013-10-25 13:25:02 -04:00
Neil Lalonde 8aab2253d0 Whitelisted ip addresses will not be flagged as spam by flag_sockpuppets 2013-10-23 17:11:35 -04:00
Neil Lalonde 3c2c6ab24b Add sockpuppet spammer detection. Automatically flag posts if they are from new users (registered less than 24 hours ago) at the same IP address and one of them started the topic. 2013-10-11 13:34:05 -04:00
Neil Lalonde cde631cbd1 Change default of notify_mods_when_user_blocked to false 2013-09-05 11:27:24 -04:00
Neil Lalonde 7eaedb84e1 Add notify_mods_when_user_blocked site setting to control whether moderators get a message when someone is automatically blocked 2013-08-19 12:00:48 -04:00
Neil Lalonde 8cc49d9797 Don't send more pm's after a user has been blocked from making posts. This can happen if a staff member flags posts that are already hidden. 2013-08-02 10:55:19 -04:00
Neil Lalonde 075ed1ab53 Refactor user blocking code; hide the Block button in admin 2013-07-02 14:42:53 -04:00
Neil Lalonde 246148d4ff Make topics invisible when first post is automatically hidden because of spam flags 2013-06-12 16:02:11 -04:00
Neil Lalonde 9b1d0baf45 Send a message to moderators when a newuser_spam_host_threshold is exceeded. Send it no more than once per day per user. 2013-06-10 13:17:32 -04:00
Neil Lalonde 564d242832 Notify moderators when someone is automatically blocked because of spam flags 2013-06-06 18:49:19 -04:00
Neil Lalonde c4904aacc0 Automatically flag someone as a spammer if their posts get at least X spam flags from N users while their trust level is 'new user'. Staff can clear and set this status from the user record in admin. 2013-06-03 16:37:40 -04:00