Commit Graph

38 Commits

Author SHA1 Message Date
Donovan Daniels
8a3e70e5ca
[AvoidPosting] Integrate the avoid posting list into the site (#582) 2024-08-03 14:15:26 -07:00
Donovan Daniels
0346f86ac7
[Artists] Convert is_active into proper deletion (#660) 2024-07-20 11:45:36 -07:00
Earlopain
fc7d84affd
[RuboCop] Enable Style/FrozenStringLiteralComment
This reduces allocations on the posts page by about 5%, from basic testing
2024-02-25 18:15:55 +01:00
Earlopain
de3f7d6a6e
[Tests] Fix random failures
Sometimes the seconds tick over to the next one during execution,
resulting in failures. This should be the end of that.
2023-02-27 13:00:28 +01:00
Earlopain
6a530993bc
[Artists] Fix wiki page renaming on alias approval
It was trying to set the body to nil since @notes wasn't set.
2023-02-25 00:03:32 +01:00
Earlopain
918a3f491d
[Tests] Remove useless travel_to 2022-11-26 13:52:37 +01:00
Earlopain
b6fb6d3ee6
[Tests] Remove as_user helper 2022-11-26 12:49:35 +01:00
Earlopain
87313c437c [Tests] Include FactoryBot::Syntax::Methods
The newly included create method behaves exacly like the self-written one,
with the added benefit of it not appearing in backtraces.
2022-11-25 21:06:54 +01:00
Earlopain
348827de5d
[Tests] Fix artist tests 2022-02-19 17:07:58 +01:00
Earlopain
e3728546c7
[Cleanup] Remove artist banning 2022-02-19 16:54:26 +01:00
Kira
4024108f1c Convert builder -> janitor for user rank 2019-06-29 12:58:28 -07:00
evazion
1e710e1ae0 tests: fix typo in artist controller test. 2018-10-04 21:55:17 -05:00
evazion
d1e9f9c3ce Fix broken test artist controller tests, tag alias test. 2018-09-26 00:42:47 -05:00
evazion
10ca4dd3ad artists: replace artist finder with fetch source data.
* On posts, automatically trigger "Fetch source data" when clicking the
  Edit tab, instead of triggering the artist finder button. This way we
  find both the artist and the translated tags in one ajax call.

* Remove the "Artist" finder button next to the source field. This isn't
  necessary given that "Fetch source data" finds the artist itself.

* Remove the /artists/finder.json API endpoint. This is no longer used
  after removing the "Artist" finder button.
2018-09-11 20:09:25 -05:00
Albert Yi
856637ace4 fix tests 2018-06-05 15:51:06 -07:00
Albert Yi
63ab637419 potential fix for #3727 2018-05-25 10:16:52 -07:00
Albert Yi
8b16934aaa skip pixiv-related tests that throw networking errors 2018-05-15 10:19:20 -07:00
Albert Yi
8d5db3723b skip tests that throw an net::opentimeout error 2018-05-14 10:45:46 -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
evazion
ce06736374 tests: fix timestamp comparison in artist notes saving test.
Equality test failed due to microsecond level differences. Truncate to
seconds to avoid this.
2018-01-20 13:08:40 -06:00
evazion
cc54c16fac /artists/show_or_new: make public; add "artist doesn't exist" page.
* Fix access denied error when anonymous users open /artists/show_or_new.

* When the artist doesn't exist, take user to "artist doesn't exist"
  page instead of redirecting to /artists/new.
2017-07-06 18:37:13 -05:00
evazion
eac827973b Normalize pixiv artist urls to pixiv member page (fix #3048). 2017-05-15 14:12:08 -05:00
r888888888
68f057e7ba refactor how artist notes are updated 2017-04-18 17:07:12 -07:00
evazion
77b4dfcdfb tests: add artist controller tests. 2017-02-06 18:48:35 -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
80895ef46e Add tests for reverting to foreign versions. 2016-10-11 06:57:05 +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
9bdc0116bf fix pixiv tests 2015-05-14 16:50:24 -07: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
Toks
11871d88b6 fixes #1844
closes #1653
2013-10-26 00:08:37 -04:00
r888888888
513c0f8eeb fixes #1427 2013-04-23 17:07:33 -07:00
小太
cba839ba76 Kill trailing whitespace in ruby files 2013-03-19 23:10:10 +11:00
albert
17881068e1 * Removed Pixa/Tinami sources
* Upgraded to Rails 3.2.3
* Fixed tests
2012-06-01 19:22:58 -04:00
albert
c14f020ce2 * Fix for Pixiv changes
* Fix for artist/wiki pages for -names
2012-02-08 12:44:17 -05:00
albert
0de90d487b fixed tests 2011-10-22 19:01:27 -04:00
albert
46164eab4f finished dmails and favorites functional tests 2010-12-05 22:27:45 -05:00
albert
976a25a6c6 additional functional tests, some controller fixes 2010-12-01 18:50:04 -05:00
albert
ac98d7db37 stubbed in blank controllers/helpers/functional tests 2010-03-10 18:21:43 -05:00