Commit Graph

62 Commits

Author SHA1 Message Date
Albert Yi
99012ff342 fix tests 2018-05-09 11:59:51 -07:00
Albert Yi
06559c4ae4 fix missing urls in artists (fixes #3632) 2018-04-13 12:25:49 -07:00
r888888888
abce4d2551 Raise error on unpermitted params.
Fail loudly if we forget to whitelist a param instead of silently
ignoring it.

misc models: convert to strong params.

artist commentaries: convert to strong params.

* Disallow changing or setting post_id to a nonexistent post.

artists: convert to strong params.

* Disallow setting `is_banned` in create/update actions. Changing it
  this way instead of with the ban/unban actions would leave the artist in
  a partially banned state.

bans: convert to strong params.

* Disallow changing the user_id after the ban has been created.

comments: convert to strong params.

favorite groups: convert to strong params.

news updates: convert to strong params.

post appeals: convert to strong params.

post flags: convert to strong params.

* Disallow users from setting the `is_deleted` / `is_resolved` flags.

ip bans: convert to strong params.

user feedbacks: convert to strong params.

* Disallow users from setting `disable_dmail_notification` when creating feedbacks.
* Disallow changing the user_id after the feedback has been created.

notes: convert to strong params.

wiki pages: convert to strong params.

* Also fix non-Builders being able to delete wiki pages.

saved searches: convert to strong params.

pools: convert to strong params.

* Disallow setting `post_count` or `is_deleted` in create/update actions.

janitor trials: convert to strong params.

post disapprovals: convert to strong params.

* Factor out quick-mod bar to shared partial.
* Fix quick-mod bar to use `Post#is_approvable?` to determine visibility
  of Approve button.

dmail filters: convert to strong params.

password resets: convert to strong params.

user name change requests: convert to strong params.

posts: convert to strong params.

users: convert to strong params.

* Disallow setting password_hash, last_logged_in_at, last_forum_read_at,
  has_mail, and dmail_filter_attributes[user_id].

* Remove initialize_default_image_size (dead code).

uploads: convert to strong params.

* Remove `initialize_status` because status already defaults to pending
  in the database.

tag aliases/implications: convert to strong params.

tags: convert to strong params.

forum posts: convert to strong params.

* Disallow changing the topic_id after creating the post.
* Disallow setting is_deleted (destroy/undelete actions should be used instead).
* Remove is_sticky / is_locked (nonexistent attributes).

forum topics: convert to strong params.

* merges https://github.com/evazion/danbooru/tree/wip-rails-5.1
* lock pg gem to 0.21 (1.0.0 is incompatible with rails 5.1.4)
* switch to factorybot and change all references

Co-authored-by: r888888888 <r888888888@gmail.com>
Co-authored-by: evazion <noizave@gmail.com>

add diffs
2018-04-06 18:09:57 -07:00
r888888888
4a80d6c337 refactor User#validate_sock_puppet to disable for tests 2018-01-02 14:32:38 -08:00
evazion
859fe99a80 Fix #2696: Bogus results on non-matching URL searches for Artists 2017-12-17 21:00:34 -06:00
r888888888
4b2dcca8a2 use tag name validator for artist names #3328 2017-10-09 16:24:09 -07:00
evazion
624444d51d artists: validate that urls are well-formed (fix #2346). 2017-07-29 01:44:05 -05:00
evazion
6121b8cb25 artists: simplify artist url saving code.
Refactor the way artist urls are saved so that artist url validations
run before the artist is saved, not after.
2017-07-29 01:41:37 -05:00
evazion
dc36476d50 nijie: don't return bogus artists when artist finder finds no match. 2017-06-20 17:09:57 -05:00
evazion
3560bbbd47 pawoo: don't return bogus artists when artist finder doesn't find a match. 2017-06-19 17:10:02 -05:00
r888888888
bffa1f3dc3 fix unit tests 2017-05-30 17:37:42 -07:00
r888888888
216ca06fee fixes #3100 2017-05-30 15:38:01 -07:00
evazion
eac827973b Normalize pixiv artist urls to pixiv member page (fix #3048). 2017-05-15 14:12:08 -05:00
evazion
d1188d8184 /artists: add search params: has_tag, name/other_names/group_name/any_name/url_matches. 2017-04-26 14:08:18 -05:00
r888888888
68f057e7ba refactor how artist notes are updated 2017-04-18 17:07:12 -07:00
evazion
c0e5c400a7 tests: fix tests for Rails.cache. 2017-04-16 16:48:36 -05:00
evazion
beddc34958 tests: set Delayed::Worker.delay_jobs = false globally. 2017-02-04 17:18:51 -06:00
Albert Yi
0ea7d78584 remove usage of vcr cassettes; delete unused fixtures; fix some broken unit tests 2016-12-28 15:47:28 -08:00
evazion
1e9bcf75de Test banning artist sets approver of banned_artist implication. 2016-10-26 21:52:19 -05:00
Albert Yi
2a5343b8cf add more intelligent js for artist forms 2016-10-18 14:56:40 -07:00
evazion
b6af41e0f8 Add test cases for twitter artist finder. 2016-10-05 08:13:27 +00:00
r888888888
fc7afd44ea refactor source pixiv test
refactor pixiv download tests
refactor upload test
refactor nico seiga test
refactor twitter tests
2016-09-28 11:25:29 -07:00
r888888888
58aa5c6d66 fix tests 2016-05-28 14:08:44 -07:00
r888888888
ce3af81c9f fix tests 2016-01-18 17:13:26 -08:00
r888888888
6ce5223399 fixes #2526: Don't allow special characters ('*', etc...) in artist names 2015-10-06 15:03:12 -07:00
r888888888
9bdc0116bf fix pixiv tests 2015-05-14 16:50:24 -07:00
r888888888
593759fbfe add test for pixiv artist search by profile url 2015-02-15 13:14:26 -08:00
r888888888
f9c341a794 dont recreate artist urls that havent changed 2014-12-03 15:01:22 -08:00
evazion
a36472f35b Add artist finding tests for new Pixiv URLs.
* Add tests for finding artists using the new Pixiv URLs in Artist#find_all_by_url.
* Add tests for the artist finder JSON API in ArtistsController#finder.
* Add tests for the artist page search form in ArtistsController#index.
2014-10-05 14:11:31 -05:00
r888888888
c228b5d855 fixes #1897 2014-03-18 13:03:38 -07:00
Toks
01b847d07f #1383: Remove banned_artist tag 2014-03-07 20:21:07 -05:00
r888888888
0724f6ca06 fixes #1383 2014-03-07 16:42:20 -08:00
Toks
f4596830c4 Partial fix for #1520 2014-01-08 15:54:27 -05:00
Toks
5cfea6a3d0 fixes #1211 for renamed artists 2013-10-26 00:13:09 -04:00
Toks
11871d88b6 fixes #1844
closes #1653
2013-10-26 00:08:37 -04:00
r888888888
3edf160887 fixes #1211 2013-08-07 13:00:25 -07:00
r888888888
b0d70ede4c fixes #1653 2013-05-31 15:34:25 -07:00
r888888888
09e117049b fixes #1573 2013-05-08 11:48:09 -07:00
albert
6c54d89a36 * All users can now view deleted posts.
* Posts now have an is_banned flag for artist removal requests.  Basic users can not view banned posts but gold and higher can.
* Banning an artist both deletes the post and bans it.
* By default deleted posts are not filtered out of post searches at the sql level.
2013-03-22 09:38:53 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
d21c4500d2 fixed tests 2013-03-18 03:26:02 -04:00
albert
dbdbdd2337 fix artist test 2013-02-23 10:58:31 -05:00
albert
d16a240eda for artist urls, normalize https 2013-02-21 16:13:06 -05:00
albert
b03e889cdd fixed tests 2013-02-20 16:24:59 -05:00
albert
c7ffda81bf improved artist test 2013-01-11 16:38:06 -05:00
albert
8749c43b3e refactored search 2013-01-10 17:45:52 -05:00
albert
17881068e1 * Removed Pixa/Tinami sources
* Upgraded to Rails 3.2.3
* Fixed tests
2012-06-01 19:22:58 -04:00
albert
157789d4d5 added additional artist test 2012-05-11 17:53:11 -04:00
albert
c8bcf5ad7c updated to rails 3.2, fixed tests 2012-01-27 14:22:47 -05:00
albert
0de90d487b fixed tests 2011-10-22 19:01:27 -04:00