Commit Graph
546 Commits
Author SHA1 Message Date
r888888888 43f31529d7 fixes #2920: "Undo" function not working for Post Versions 2017-03-09 11:44:28 -08:00
evazion 02122343c3 dmails: don't default IP addr to 127.0.0.1 in database (fixes #2908).
Bug introduced in 1400f64; that commit changed dmails so that
creator_ip_addr defaulted to CurrentUser.ip_addr like this:

    after_initialize :initialize_attributes, if: :new_record?

    def initialize_attributes
      self.from_id ||= CurrentUser.id
      self.creator_ip_addr ||= CurrentUser.ip_addr
    end

...but creator_ip_addr already defaulted to 127.0.0.1 from the database,
so the ||= assignment didn't work. Remove the database default so we
always default to CurrentUser.ip_addr.
2017-03-01 19:51:48 -06:00
Albert Yi fd7cddc909 Merge branch 'master' into fix-mention-dmails 2017-02-27 17:00:24 -08:00
Albert Yi 1fa0aabbe0 Merge pull request #2896 from evazion/fix-username-whitespace
Disallow unicode whitespace in usernames (#2894).
2017-02-27 16:47:44 -08:00
r888888888 398f58684f Merge branch 'post-archive' 2017-02-27 10:45:13 -08:00
evazion 46280f2227 mentions: include mentioner in subject line.
The template looks like this:

Subject:

    #{creator_name} mentioned you in a comment on post ##{post_id}

Body:

    @#{creator_name} mentioned you in a \"comment\":/posts/#{post_id}#comment-#{id} on post ##{post_id}:

    [quote]
    #{DText.excerpt(body, "@"+user_name)}
    [/quote]
2017-02-25 23:05:44 -06:00
evazion 6e3ddb6ed6 dmails: don't save copies of outgoing dmails sent by DanbooruBot.
There's not much sense in saving copies of everything DanbooruBot sends
in DanbooruBot's inbox. They probably won't be checked so it just bloats
the dmails table.
2017-02-25 23:05:44 -06:00
evazion 6966b74e18 Disallow unicode whitespace in usernames (#2894). 2017-02-25 01:51:33 -06:00
evazion 6704e71377 dmails: add tests for automated dmails. 2017-02-23 22:51:17 -06:00
r888888888 6bd03ee4db fix tests 2017-02-21 15:04:55 -08:00
Albert Yi 5404c1d231 implement postarchive 2017-02-21 13:40:52 -08:00
r888888888 6c9d5e4f9a remove advertisement code 2017-02-21 13:35:22 -08:00
evazion f971f927fd post_test.rb: add tag name validation tests. 2017-02-08 23:31:30 -06:00
r888888888 c01f48f18c mock pool archive service in post test 2017-02-07 14:14:36 -08:00
Albert Yi b1c33f2379 Merge pull request #2878 from evazion/fix-test-coverage
Improve controller test coverage
2017-02-07 13:45:16 -08:00
r888888888 7a3d1c7d1d dont download original artstation images if they dont exist 2017-02-07 13:40:19 -08:00
r888888888 39b6601afe Merge branch 'artstation' 2017-02-06 17:07:57 -08:00
r888888888 7a2f652152 add source strategy for artstation 2017-02-06 17:07:09 -08:00
evazion 35b3398142 post_test.rb: add more metatag search tests. 2017-02-06 18:48:39 -06:00
evazion cac5eae3c4 tests: add more tags controller/model tests. 2017-02-06 18:48:39 -06:00
evazion 3edd814be5 tests: add iqdb queries controller tests. 2017-02-06 18:48:37 -06:00
r888888888 5c16e9ce48 add download strategy for artstation 2017-02-06 12:03:00 -08:00
r888888888 6bf050c607 add download strategy for artstation 2017-02-06 11:59:27 -08:00
evazion e8cf417e9c tests: update gems to latest versions.
Also fix a few things that broke under shoulda-matchers 3.1.1.
2017-02-04 22:17:15 -06:00
evazion 9b16c45edc test_helper.rb: factor out upload test helpers. 2017-02-04 17:18:52 -06:00
evazion beddc34958 tests: set Delayed::Worker.delay_jobs = false globally. 2017-02-04 17:18:51 -06:00
evazion cd3b09b10a tag_alias_correction_test.rb: fix assert_nil deprecation warning.
Use assert_nil if expecting nil from /home/danbooru/src/danbooru/test/unit/tag_alias_correction_test.rb:29
in `block (3 levels) in <class:TagAliasCorrectionTest>'. This will fail in MT6.
2017-02-04 17:06:59 -06:00
evazion 9429f54632 alias_and_implication_importer_test.rb: fix test failures.
1) Error:
AliasAndImplicationImporterTest#test_: The alias and implication importer given a valid list should process it. :
NoMethodError: undefined method `role' for nil:NilClass
  app/models/tag_alias.rb:124:in `rescue in process!'
  app/models/tag_alias.rb:135:in `process!'
  app/models/tag_alias.rb:93:in `approve!'
  app/logical/alias_and_implication_importer.rb:90:in `block (2 levels) in parse'
  app/logical/alias_and_implication_importer.rb:82:in `map'
  app/logical/alias_and_implication_importer.rb:82:in `block in parse'
  app/logical/alias_and_implication_importer.rb:81:in `parse'
  app/logical/alias_and_implication_importer.rb:13:in `process!'
  test/unit/alias_and_implication_importer_test.rb:24:in `block (4 levels) in <class:AliasAndImplicationImporterTest>'
  test/unit/alias_and_implication_importer_test.rb:23:in `block (3 levels) in <class:AliasAndImplicationImporterTest>'
2017-02-04 17:06:59 -06:00
evazion a327854017 Fix post_update_count increment test.
7) Failure:
PostTest#test_: Tagging: A post that has been updated should increment the updater's post_update_count. [/home/danbooru/src/danbooru/test/unit/post_test.rb:1010]:
"CurrentUser.post_update_count" didn't change by 1.
Expected: 1
  Actual: 3
2017-02-03 04:04:02 -06:00
evazion 27817cffcf Fix saved search test.
16) Failure:
SavedSearchTest#test_: Fetching the post ids for a search with a name should return a list of ids. [/home/danbooru/src/danbooru/test/unit/saved_search_test.rb:31]:
Expected: [1, 2, 3, 4]
  Actual: []
2017-02-03 04:03:44 -06:00
evazion ace7d0c12d Fix moving saved searches tests.
4) Failure:
TagAliasTest#test_: A tag alias should move saved searches. [/home/danbooru/src/danbooru/test/unit/tag_alias_test.rb:80]:
Expected: "123 bbb 456"
  Actual: "123 ... 456"

 36) Failure:
Moderator::TagBatchChangeTest#test_: a tag batch change should move saved searches. [/home/danbooru/src/danbooru/test/unit/moderator/tag_batch_change_test.rb:40]:
Expected: "123 456 bbb"
  Actual: "123 ... 456"
2017-02-03 04:03:44 -06:00
evazion 72502dbe2f Fix comment voting tests.
2) Error:
CommentTest#test_: A comment created by an unlimited user should not allow duplicate votes. :
ActiveRecord::RecordInvalid: Validation failed: You have already voted for this comment
    app/models/comment.rb:142:in `vote!'
    test/unit/comment_test.rb:164:in `block (3 levels) in <class:CommentTest>'

  3) Error:
CommentTest#test_: A comment created by an unlimited user should not allow upvotes by the creator. :
ActiveRecord::RecordInvalid: Validation failed: You cannot upvote your own comments
    app/models/comment.rb:142:in `vote!'
    test/unit/comment_test.rb:179:in `block (3 levels) in <class:CommentTest>'
2017-02-03 04:03:44 -06:00
r888888888 f78160827f remove unused config 2017-01-24 13:13:13 -08:00
evazion 601b439f96 Add order:comment_bumped, order:comment_bumped_asc metatags. 2017-01-21 11:10:40 +00:00
evazion cf046eecbf Fix ip addr search tests. 2017-01-12 09:28:52 +00:00
Albert Yi f2a5d45db0 implement token bucket rate limiting 2017-01-09 17:31:14 -08:00
Albert Yi b9a1e115fb add additional mod actions 2017-01-03 16:02:36 -08: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
Albert Yi b2296cab70 bug fix for saved search update on tag batch changes 2016-12-28 12:40:00 -08:00
Albert Yi 3ad639521f fixes #2805: Improve nico seiga support 2016-12-27 16:11:22 -08:00
evazion 0e73f3c8a9 Add tests for stickying comments. 2016-12-26 23:52:46 -06:00
Albert Yi 5a1ac41450 eliminate transaction log items table 2016-12-21 15:00:59 -08:00
Albert Yi 62956be384 hide saved search functionality if not enabled 2016-12-21 14:53:39 -08:00
Albert Yi ee4ebce4d7 support pool version archive 2016-12-21 11:43:46 -08:00
Albert Yi b0f2b1e8dd Merge pull request #2782 from evazion/fix-2779
Fix #2779: Erroneous pixiv_id parsed for novel/background/profile images
2016-12-05 11:44:38 -08:00
evazion e7bc3048ed Test downloading pixiv profile/background/novel images. 2016-12-04 02:04:44 -06:00
evazion 96a38f8d1b Test pixiv id parsing for novel/background/profile images. 2016-12-04 02:04:44 -06:00
evazion 01afc46f74 Fix failures in commenting tests.
Restricting users from upvoting their own comments broke some tests.
Switch these tests to downvoting instead.
2016-12-03 20:06:50 -06:00
evazion 0697af6d23 Fix #2771: Approving deleted image doesn't create mod action. 2016-11-28 02:50:07 -06:00
Albert Yi 0b9c1e1156 Merge pull request #2759 from evazion/fix-dmail-filters
Don't filter dmails from moderators; fix dmail filter exploit.
2016-11-14 16:27:17 -08:00