Commit Graph

5284 Commits

Author SHA1 Message Date
Gerhard Schlager
2564a8285d REFACTOR: Run some parts of user anonymizing in background job 2018-06-08 15:50:07 +02:00
Gerhard Schlager
cf038cf72a FEATURE: Remove more PII during user anonymizing
Removes
  * invite if the user was invited
  * email tokens
  * incoming emails
  * email log entries
  * raw emails from posts
2018-06-08 15:50:07 +02:00
OsamaSayegh
f5ad0022f7 REFACTOR: admin users controller specs to requests (#5946) 2018-06-08 12:42:06 +08:00
Guo Xiang Tan
8e0c1c8782 Re-enable skipped specs. 2018-06-08 10:04:06 +08:00
Arpit Jalan
f9ab3848ed FEATURE: support disabling emails for non-staff users 2018-06-07 18:31:08 +05:30
Sam
945cb90e7e update specs 2018-06-07 20:55:42 +10:00
Guo Xiang Tan
3a8f69c3d2 DEV: Assert for 200 response code to avoid changing magic helper in the future. 2018-06-07 16:11:09 +08:00
OsamaSayegh
1e805cfd3e REFACTOR: composer messages controller specs to requests (#5940) 2018-06-07 13:51:52 +08:00
OsamaSayegh
c6c1ef71c1 REFACTOR: inline onebox controller specs to requests 2018-06-07 13:11:45 +08:00
OsamaSayegh
30be1b0d2b REFACTOR: category hashtags controller specs to requests (#5936) 2018-06-07 13:09:23 +08:00
OsamaSayegh
9975f9751e REFACTOR: metadata controller specs to requests (#5935) 2018-06-07 13:08:28 +08:00
OsamaSayegh
1957cb541b REFACTOR: permalinks controller specs to requests (#5934) 2018-06-07 13:08:13 +08:00
OsamaSayegh
f2a5a84f0b REFACTOR: similar topics controller specs to requests (#5933) 2018-06-07 13:07:53 +08:00
OsamaSayegh
37829a521a REFACTOR: stylesheets controller specs to requests 2018-06-07 13:06:32 +08:00
OsamaSayegh
a8d33603f9 REFACTOR: export CSV controller specs to requests 2018-06-07 13:02:02 +08:00
OsamaSayegh
0124209a96 REFACTOR: site controller specs to requests 2018-06-07 12:58:33 +08:00
OsamaSayegh
3c96ee4b6f REFACTOR: clicks controller specs to requests (#5929) 2018-06-07 12:57:29 +08:00
OsamaSayegh
2688cc6241 REFACTOR: post action users controller specs to requests 2018-06-07 12:55:01 +08:00
OsamaSayegh
e2e566214d REFACTOR: user avatars controller spec to requests 2018-06-07 12:53:33 +08:00
OsamaSayegh
05c1fe5c8f REFACTOR: user actions controller specs to requests 2018-06-07 12:52:06 +08:00
OsamaSayegh
7f21892ad0 REFACTOR: finish installation controller specs to requests 2018-06-07 12:49:47 +08:00
OsamaSayegh
5ecaa55e50 REFACTOR: webhooks controller specs to requests 2018-06-07 12:46:29 +08:00
Guo Xiang Tan
4782f6cd01 Remove controller type spec for post actions. 2018-06-07 12:45:38 +08:00
OsamaSayegh
cc82fb33b5 REFACTOR: queued posts controller specs to requests 2018-06-07 12:41:26 +08:00
OsamaSayegh
1b7d46c054 REFACTOR: post actions controller specs to requests 2018-06-07 12:38:17 +08:00
OsamaSayegh
f75d1e958d REFACTOR: extra locales controller specs to requests 2018-06-07 12:34:39 +08:00
Sam
f331d2603d DEV: improve design of site setting default provider
This refactors it so "Defaults provider" is only responsible for "defaults"

Locale handling and management of locale settings is moved back into
SiteSettingExtension

This eliminates complex state management using DistributedCache and makes
it way easier to test SiteSettingExtension
2018-06-07 14:33:41 +10:00
OsamaSayegh
d2880246cd REFACTOR: steps controller specs to requests 2018-06-07 12:31:13 +08:00
Guo Xiang Tan
47ddb3a7ca Merge branch 'wizard-controller' of https://github.com/OsamaSayegh/discourse into OsamaSayegh-wizard-controller 2018-06-07 12:27:48 +08:00
OsamaSayegh
600ff85ecd REFACTOR: draft controller specs to requests (#5942) 2018-06-07 12:24:20 +08:00
OsamaSayegh
f5178ded56 REFACTOR: offline controller spec to requests (#5943) 2018-06-07 12:24:05 +08:00
Sam
89ad2b5900 DEV: Rails 5.2 upgrade and global gem upgrade
This updates tests to use latest rails 5 practice
and updates ALL dependencies that could be updated

Performance testing shows that performance has not regressed
if anything it is marginally faster now.
2018-06-07 14:21:33 +10:00
Vinoth Kannan
d8e641cd98 FIX: avatar_url includes upload_path twice when local storage used 2018-06-06 18:27:30 +05:30
OsamaSayegh
3244fb8959 REFACTOR: wizard controller specs to requests 2018-06-06 12:07:55 +03:00
Guo Xiang Tan
a83ab01264 REFACTOR: Remove extra param for group mentionable and messableable route. 2018-06-06 09:42:09 +08:00
Arpit Jalan
f8d82f135f FIX: do not verify group visibility when checking for mentionable/messageable 2018-06-05 16:59:21 +05:30
OsamaSayegh
d3e610eed9 REFACTOR: topic controller (2) specs to requests (#5911) 2018-06-05 12:03:49 +08:00
OsamaSayegh
475d944d74 REFACTOR: onebox controller specs to requests (#5914) 2018-06-05 11:36:08 +08:00
OsamaSayegh
22fcc04d38 REFACTOR: user badges controller specs to requests (#5912) 2018-06-05 10:59:01 +08:00
OsamaSayegh
79dcd79470 REFACTOR: email controller specs to requests (#5917) 2018-06-05 10:57:11 +08:00
Guo Xiang Tan
a508e6a5f6 DEV: Stablize requests/search_controller_spec. 2018-06-05 10:07:05 +08:00
Guo Xiang Tan
aaea24448e DEV: Add specs for 085eaaf18d. 2018-06-05 10:03:26 +08:00
Guo Xiang Tan
d600e71b3d FIX: Clean up stale UserExport records daily.
* Add tests for `UserExport.remove_old_exports`
2018-06-05 09:43:40 +08:00
Guo Xiang Tan
dcba320bf6 Remove spec that isn't testing for anything. 2018-06-05 09:30:02 +08:00
Arpit Jalan
46fc57222f FEATURE: improve handling of site setting secrets 2018-06-04 21:31:34 +05:30
OsamaSayegh
bc75cfe4b5 REFACTOR: tags controller specs (#5908) 2018-06-04 14:09:14 +08:00
OsamaSayegh
1f8805d3af REFACTOR: user api keys contoller specs to request 2018-06-04 16:07:53 +10:00
OsamaSayegh
807223deef REFACTOR: notifications controller specs to requests 2018-06-04 16:06:53 +10:00
OsamaSayegh
e4bdafb550 REFACTOR: categories controller specs to requests (#5903)
REFACTOR: categories controller specs to requests
2018-06-04 12:04:32 +08:00
OsamaSayegh
e58ed247f2 REFACTOR: uploads controller specs to requests (#5907) 2018-06-04 11:13:52 +08:00
OsamaSayegh
cfea837e88 REFACTOR: search controller specs to requests (#5906) 2018-06-04 11:12:38 +08:00
OsamaSayegh
9b4a98695e REFACTOR: list controller specs to requests (#5902) 2018-06-04 11:09:59 +08:00
Arpit Jalan
36f9af4fa4 minor optimizations for post rejected logs 2018-06-02 09:44:55 +05:30
Arpit Jalan
89eca87f16 FEATURE: add staff action log for post rejections 2018-06-01 21:48:27 +05:30
Gerhard Schlager
c0bab84dc1 Fix random build error
Spec usually failed when there was an UpdateGravatar job for the system user.
2018-06-01 17:34:19 +02:00
Gerhard Schlager
b970b072f6 FIX: User merge should not fail when primary email address is missing
The merge process might move all email addresses of the source user to the target user. Destroying the source user failed in that case.
2018-06-01 16:23:21 +02:00
OsamaSayegh
474ff94df3 REFACTOR: convert invites controller specs to requests (#5898)
REFACTOR: convert invites controller specs to requests
2018-06-01 13:06:08 +08:00
Guo Xiang Tan
d57a5d3e8c Fix brittle spec. 2018-06-01 11:56:56 +08:00
Guo Xiang Tan
12a0f12530 Fix the build. 2018-06-01 11:24:32 +08:00
Blake Erickson
7750b30016 FIX: Allow a user to remove their title
Somewhere there was a regression and a user couldn't remove their own
title. If they selected '(none)' in the UI it would say it was saved,
but it would not actually be updated in the db.
2018-05-31 17:16:52 -06:00
OsamaSayegh
d4848f2d58 REFACTOR: topics controller specs to requests (#5886)
* REFACTOR: topics controller specs to requests
2018-05-31 22:45:32 +08:00
Guo Xiang Tan
7fc8a36529 DEV: Take 2 Queue jobs in tests by default.
On my machine this cuts the time taken to run our test suite
from ~11mins to ~9mins.
2018-05-31 16:23:23 +08:00
Guo Xiang Tan
56e9ff6853 Revert "DEV: Queue jobs in tests by default."
Too risky for now

This reverts commit be28154d3b.
2018-05-31 15:34:46 +08:00
Guo Xiang Tan
2b783997fa Refactor tests to complete assertions within a single it block. 2018-05-31 15:05:47 +08:00
Sam
5086fdc76d FIX: add protection for scss removal during upgrade
In some cases plugins would remove scss files or change them, but CSS
was still calculated based off stale data in old instance cache
2018-05-31 17:02:48 +10:00
Guo Xiang Tan
be28154d3b DEV: Queue jobs in tests by default. 2018-05-31 14:45:47 +08:00
Guo Xiang Tan
95f9b72351 FIX: Update activation email route was returning a generic json error. 2018-05-31 14:19:43 +08:00
OsamaSayegh
4e21a031df Remove trailing whitespace 2018-05-31 12:31:46 +10:00
OsamaSayegh
23e3a68592 REFACTOR: session controller specs to requests 2018-05-31 12:31:46 +10:00
Guo Xiang Tan
f623740ffc DEV: Stablize DiscourseRedis tests. 2018-05-30 14:45:19 +08:00
Guo Xiang Tan
21e9315416 FIX: Use user account email instead of auth email when totp is enabled.
https://meta.discourse.org/t/github-2fa-flow-broken/88674
2018-05-30 12:15:12 +08:00
Guo Xiang Tan
543b7cddfb FIX: Extra comma resulted in Github auth email result being an array.
https://meta.discourse.org/t/github-2fa-flow-broken/88674
2018-05-30 12:15:12 +08:00
Neil Lalonde
e26a14dc29 FIX: error when flagging to notify moderators because message title is too long 2018-05-29 12:21:47 -04:00
Sam
df815d6c0e DEV: prefer using ordering in relation over default scope 2018-05-29 09:34:12 +10:00
Arpit Jalan
c8bc942333 FIX: do not add invited user to automatic groups 2018-05-28 17:17:48 +05:30
Guo Xiang Tan
81b5d61fa7 FIX: topic_destroyed web hook couldn't find topic. 2018-05-28 17:38:02 +08:00
Gerhard Schlager
ed2ae3cb0a FIX: Load post revisions in correct order 2018-05-28 11:25:24 +02:00
Guo Xiang Tan
123a22e6d8 DEV: Clean up omniauth after mocking. 2018-05-28 15:12:54 +08:00
Guo Xiang Tan
a081771950
Merge pull request #5872 from OsamaSayegh/users-controller-specs-to-request
REFACTOR: users contollers specs => request specs
2018-05-28 13:32:37 +08:00
Sam
e501936405 FIX: search server side error in rare condition 2018-05-28 15:28:18 +10:00
OsamaSayegh
0347c97520 tgxworld feedback 2018-05-28 06:20:47 +03:00
Sam
5a32a70d6c FIX: ColorScheme color missing was returning "nil" 2018-05-28 11:46:00 +10:00
Robin Ward
4195c7c9ea FEATURE: Ability to clear a user's penalty history
You can do this manually if you want to allow them to reach TL3 without
their penalty history counting against them.
2018-05-25 12:54:22 -04:00
Gerhard Schlager
20b94bc714 FIX: Extraction of quoted posts failed in some cases
* It stored only oneboxed "quotes" when [quote] and links to topics or posts were mixed.
* Revising a post didn't add or remove records from the quoted_posts table.
2018-05-25 12:00:17 +02:00
riking
12e4dd59b7 Style fix for test 2018-05-25 15:54:14 +10:00
riking
501bc0e9af FIX: UserProfileView: Do not log IP of logged-in users 2018-05-25 15:54:14 +10:00
Sam
9c91c2509e improve spec stability 2018-05-25 15:16:40 +10:00
Sam
610bfec73e DEV: correct fragile spec 2018-05-25 14:29:11 +10:00
Sam
720a12ce76 correct time dependent spec 2018-05-25 14:26:05 +10:00
Sam
be1b8fc3a8 DEV: ensure specs run in consistent times 2018-05-25 14:22:43 +10:00
Guo Xiang Tan
755b511b5c PERF: Destroy collapsed notifications in 1 query instead of 3. 2018-05-25 12:01:36 +08:00
Sam
80adc1ee80 DEV: stabilize site setting spec
side effects could cause specs to fail in rare conditions
2018-05-25 12:16:00 +10:00
OsamaSayegh
bac0482061 REFACTOR: users contollers specs => request specs 2018-05-25 05:04:25 +03:00
Guo Xiang Tan
58fbe74b6f Remove assertion to_not raise_error.
If an error is raised the test would fail anyway.
2018-05-25 09:57:08 +08:00
Guo Xiang Tan
1f27c91924 DEV: Better diagnostic when topic tracking state tests fail. 2018-05-24 15:36:41 +08:00
Guo Xiang Tan
43f7cb05c9 FIX: Broken ping event for web hooks due to missing payload. 2018-05-24 15:16:52 +08:00
Sam
d366f8d888 remove hack that destabliazed tese suite 2018-05-24 10:48:16 +10:00
Neil Lalonde
3db1032bfd FIX: not found page shouldn't include the Google search form for sites with login_required enabled 2018-05-23 16:59:02 -04:00
Andrew Schleifer
4be0e31459 fix s3_cdn_url when the s3 bucket contains a folder 2018-05-23 15:51:02 -05:00
Ryan Mulligan
fac4bf2f85 ignore emails that are from the reply by email addresses (#5843) 2018-05-23 10:04:45 +02:00
Guo Xiang Tan
ad9e0d6bea
Merge pull request #5848 from OsamaSayegh/fix-social-login-groups
FIX: apply automatic group rules when using social login providers
2018-05-23 08:17:42 +08:00
OsamaSayegh
f6d412465b FIX: apply automatic group rules when using social login providers 2018-05-23 02:26:07 +03:00
Blake Erickson
3edca8b104 Return a 403 instead of 200 when trying to delete a user with posts
See [this commit][1] for more info

[1]: bd352a17bf
2018-05-22 17:02:02 -06:00
OsamaSayegh
609804f5ef REFACTOR: merge posts controller specs into request specs 2018-05-23 08:53:46 +10:00
Sam
45f65859c9 improve erraticly failing spec 2018-05-23 08:39:15 +10:00
Gerhard Schlager
beed676b04 FIX: Check group names when checking username availability 2018-05-22 21:55:54 +02:00
Gerhard Schlager
95db5f0c8c FIX: Do not replace wrong avatars when renaming user 2018-05-22 13:41:51 +02:00
Sam
1ac1ee4287 FEATURE: allow registration of an array custom field 2018-05-22 16:48:39 +10:00
Sam
bcfd9cf8b5 attempt to stabilize spec 2018-05-22 16:15:24 +10:00
riking
d4639bc734 TEST: Add TopicLinkClick spec for ip logging 2018-05-22 16:05:38 +10:00
OsamaSayegh
450a600721 REFACTOR: about & badge controllers => requests 2018-05-22 13:45:13 +10:00
Sam
661d89f489 skip erratic spec 2018-05-22 09:42:50 +10:00
Sam
788ca1f112 FIX: stop adding email to unsubscribe url
Instead of adding email to unsubscribe url store it in redis for 1 hour
rate limit calls to unsubscribe endpoint to ensure there is no risk of
bloating redis

Also move controller to request specs
2018-05-22 09:07:03 +10:00
Guo Xiang Tan
37ad2dd936 Fix the build. 2018-05-21 17:59:47 +08:00
Guo Xiang Tan
aae5575d33 Remove spec file that was accidentally added. 2018-05-21 17:35:55 +08:00
Guo Xiang Tan
467d91347a Missing specs for Group, Tag, Category and Flag web hooks. 2018-05-21 17:29:58 +08:00
Guo Xiang Tan
bf84037f79 FIX: Payload for webhooks should be current as of the time the event was triggered.
https://meta.discourse.org/t/group-category-tag-user-deleted-webhooks-not-firing/87752
2018-05-21 17:29:58 +08:00
Guo Xiang Tan
00c6b078e3 Trim WebHookUserSerializer. 2018-05-21 17:29:58 +08:00
Guo Xiang Tan
60e7b13f59 Trim WebHookPostSerializer further. 2018-05-21 17:29:58 +08:00
Guo Xiang Tan
3ff0074e9d Trim WebHookTopicSerializer further. 2018-05-21 17:29:58 +08:00
Sam
ec337bbcb3 DEV: attempt to report last exception as the "cause" for failures
This allows our request specs to report exceptions so we can debug

May have a few false positives but generally should be quiet

TODO only wire magic in for request specs, currently happens for all
2018-05-21 17:01:50 +10:00
Guo Xiang Tan
b7b08b4173 Fix regression introduced in 2ceb107074. 2018-05-21 13:26:23 +08:00
Guo Xiang Tan
2ceb107074 Refactor tests to use the json extension instead of headers. 2018-05-21 09:49:46 +08:00
Arpit Jalan
9f422c93f6 FIX: restrict updates on confirm_old_email email templates 2018-05-19 12:19:59 +05:30
Arpit Jalan
290ee312e6 FIX: handle invalid mailto links 2018-05-18 18:02:52 +05:30
Guo Xiang Tan
b9dfb0ba10 Partially revert 531baec5b5. 2018-05-18 15:01:36 +08:00
Guo Xiang Tan
531baec5b5 Remove unused fabricator. 2018-05-18 13:37:39 +08:00
Guo Xiang Tan
416d19af27 FIX: Wrong target user displayed for user actions in activity stream.
https://meta.discourse.org/t/wrong-assigned-username-in-activity-list/73816
2018-05-18 11:28:13 +08:00
Guo Xiang Tan
417bcc5f2a Remove blank test. 2018-05-18 11:07:57 +08:00
Jeff Wong
04c7dbafa3 FIX: manifest.json better detection at mime type. Find size if uploaded 2018-05-17 14:45:24 -07:00
Jeff Wong
41ffafb65e FIX: best effort at returning correct mime types in manifest.json 2018-05-17 12:14:39 -07:00
Régis Hanol
53f8f6095d FEATURE: staff action logs when creating/updating/deleting badges 2018-05-17 18:09:27 +02:00
Arpit Jalan
9532d9a555 FIX: handle invalid tags 2018-05-17 19:33:12 +05:30
Guo Xiang Tan
b74c108c09 UX: Display group tabs in user's messages tab for non-staff as well.
https://meta.discourse.org/t/group-inboxes-in-user-messages/86787
2018-05-17 18:10:17 +08:00
Guo Xiang Tan
147ea37115 FIX: Missing notification for watching first post users when topic is recategorized.
https://meta.discourse.org/t/not-receiving-notifications-for-announcements/87275/2?u=tgxworld
2018-05-17 16:15:29 +08:00
Arpit Jalan
33899664ce FIX: handle bad user profile website 2018-05-17 13:21:24 +05:30
Arpit Jalan
539cf32f87 FIX: handle encoded mailto links when looking for upload record 2018-05-17 12:44:53 +05:30
Arpit Jalan
aee4045dd0 FIX: suggest name when username/name is provided 2018-05-17 10:36:36 +05:30
Guo Xiang Tan
f21a47eadd Improve specs to assert for the right record instead of just a count. 2018-05-17 08:47:24 +08:00
Régis Hanol
a9ebde5111 FEATURE: new 'staged' users list for admins 2018-05-17 01:52:49 +02:00
Régis Hanol
39aceed63d FIX: don't purge unactivated users with a message 2018-05-16 18:24:11 +02:00
Gerhard Schlager
ae6236d090 FIX: Changing owner of deleted reply didn't work 2018-05-16 17:03:09 +02:00
Régis Hanol
4103783821 FIX: don't use PMs in Incoming Links reports 2018-05-16 16:55:54 +02:00
Régis Hanol
131b7f5da5 make 🤖 rubocop happy 2018-05-16 16:35:04 +02:00
Joe Buhlig
3cd4c82c49 Allow parameters for group and username filters on directory (#5815) 2018-05-16 16:20:17 +02:00
Régis Hanol
5e97a9bfb7 FIX: tags in a 'visible by everyone but usable only by staff' group weren't visible by everyone 2018-05-16 09:48:19 +02:00
Guo Xiang Tan
565fa1f60e Fix regression introduced in 8cf0f51eb2. 2018-05-16 14:26:03 +08:00
Sam
21e0b7c818 avoid async report pattern and replace with simpler hijack 2018-05-16 16:05:03 +10:00
Gerhard Schlager
74c4af279a Improvements to user renaming
* don't update search index if post belongs to deleted topic
* log errors instead of crashing when updating post or revision fails
* update mentions even when the href attribute is missing
* run the background job with low priority
* replace username in all notifications
* update `action_code_who` used by small action posts
2018-05-15 21:05:51 +02:00
Gerhard Schlager
2e1b5bc8d3 FIX: Transaction in UserAnonymizer prevented avatar from updating 2018-05-15 20:47:58 +02:00