Commit Graph

24 Commits

Author SHA1 Message Date
Guo Xiang Tan bd486100c0 Remove stubs on DiscourseEvent in tests. 2017-06-01 16:21:00 +09:00
Erick Guan c463cf63d4 FEATURE: Webhook for user creation and approval 2016-09-19 10:12:55 +08:00
Guo Xiang Tan cb5be1fe8f
Upgrade rspec to 3.4.0. 2016-05-30 11:38:38 +08:00
Sam ca3e2b4da3 FEATURE: you can not drill down and see why you have badges
Clicking on badges filters down the list to a particular user.
2016-01-18 17:59:20 +11: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 6ba6a59552 FIX: Broken spec 2015-07-07 11:39:44 -04:00
Sigurður Guðbrandsson 83f719fb80 FIX: Cleaned the commit
Only changing the code I changed, not other tests.
2015-02-26 01:24:21 +00:00
Sigurður Guðbrandsson 73068d5fa3 ADD: Spec tests for User Badge triggers
NOTE: The DiscourseEvent trigger mechanism is VERY weird.
If there are ANY triggers triggered in the chain, you can't only list the one you're looking for, you have to list all triggers in the order they will come.

Example: line 98-100
:user_created and :user_verified are triggers that are introduced in PR #3237 so if this PR is accepted but not PR #3237 then lines 98-99 need to be removed.
2015-02-26 00:55:17 +00:00
Sam fe578f9944 FEATURE: Allow manual assignment of related post to badge
PERF: clean up performance of user badges admin when large number of badges exist
2015-02-25 12:53:01 +11:00
Luciano Sousa bc73238c8f controllers with rspec3 syntax 2015-01-09 14:04:02 -03:00
Régis Hanol de76b512c1 fix most deprecations in the specs (still some left) 2014-09-25 17:44:48 +02:00
riking 7317c6ed6a Fix tests for new route 2014-08-25 13:07:22 -07:00
Sam 0f9678fe49 FIX: faster update of all badges
Introduced badge triggers, introduced concept of badge that happens due to a post but has the post hidden

Delta badge grant happens once a minute, backed by redis
2014-07-23 11:46:07 +10:00
Vikhyat Korrapati 67a2b2598d Cosmetic changes. 2014-06-19 16:56:18 +05:30
Sam fe594f5d1e Merge pull request #2372 from vikhyat/badge-system
Multiple grant badges
2014-05-30 10:18:00 +10:00
Sam cf254000cf Revert "Revert "BUGFIX: improve error messages for invalid API keys""
This reverts commit e9afe28586.
2014-05-23 08:43:19 +10:00
Neil Lalonde e9afe28586 Revert "BUGFIX: improve error messages for invalid API keys" 2014-05-22 14:55:36 -04:00
Sam eeef775f21 BUGFIX: improve error messages for invalid API keys
BUGFIX: don't track last seen for message bus
2014-05-22 09:01:29 +10:00
Vikhyat Korrapati d208e4d517 Multiple grant badges. 2014-05-21 12:54:55 +05:30
Louis Rose 1574485443 Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
2014-05-06 14:41:59 +01:00
Vikhyat Korrapati 3136217fc1 Add badge page. 2014-04-17 01:57:57 +05:30
Vikhyat Korrapati de23caa871 Slightly faster badge system specs. (Shaves off ~100ms) 2014-04-16 18:08:10 +05:30
Vikhyat Korrapati dcaa069bb5 Log badge grant/revoke to the staff actions log. 2014-03-21 11:10:07 +05:30
Vikhyat Korrapati 9b26c8584e Initial badge system implementation. 2014-03-14 21:49:26 +05:30