Commit Graph
201 Commits
Author SHA1 Message Date
evazion 47ecf034a7 /posts/:id/events - fix exception when viewed by mod.
NoMethodError exception raised

    undefined method `creator' for #<PostEvent:0x007f9a298e64d8> Did you mean? creator_id
    app/views/post_events/index.html.erb:23:in `block in _app_views_post_events_index_html_erb__2088986421112502721_70150054247640'
    app/views/post_events/index.html.erb:18:in `each'
    app/views/post_events/index.html.erb:18:in `_app_views_post_events_index_html_erb__2088986421112502721_70150054247640'
    app/controllers/post_events_controller.rb:6:in `index'
2017-03-21 17:17:18 -05:00
evazion 5ba1df5502 /posts/:id/events: list is_resolved correctly for appeals.
/posts/:id/events incorrectly lists appeals as always being resolved.
This is because events UNION together appeals and flags, which doesn't
quite work because for appeals is_resolved is a method, not an
attribute. is_resolved was hardcoded to true so it'd work in the UNION.

This changes PostEvent to be a wrapper object around PostFlag /
PostAppeal, instead of a UNION. PostEvent delegates everything to the
inner flag/appeals object, so that is_resolved works correctly.

Also, this incidentally fixes a problem with /posts/:id/event.xml not
serializing correctly.
2017-03-19 22:47:10 -05:00
r888888888 d9a26975ba fix tests 2017-03-15 16:08:47 -07:00
r888888888 398f58684f Merge branch 'post-archive' 2017-02-27 10:45:13 -08:00
evazion d852f98e4f /dmails: remove unused search[owner_id] param.
/dmails is restricted to viewing dmails for CurrentUser only (due to
Dmail.visible in the index action). Remove owner_id from subnavbar links
in /dmails, and don't support it in /dmails?search[owner_id], since it
doesn't actually do anything.

Also removes related dead methods and fixes tests that didn't test owner_id properly.
2017-02-23 22:51:17 -06: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
r888888888 291e9acdc7 fixes #2885: "Is Deleted" not being recorded correctly for Wiki Page Versions 2017-02-15 15:32:41 -08:00
evazion cac5eae3c4 tests: add more tags controller/model tests. 2017-02-06 18:48:39 -06:00
evazion 2b4c722bd1 tests: add more notes controller tests. 2017-02-06 18:48:38 -06:00
evazion 0890c6320b tests: add more comments controller tests. 2017-02-06 18:48:38 -06:00
evazion 73e274b2e0 tests: add more moderator/post/queues controller tests. 2017-02-06 18:48:38 -06:00
evazion a120a63d3b tests: add more moderator/post/posts controller tests. 2017-02-06 18:48:38 -06:00
evazion cdafbc849d tests: add more artist commentary controller tests. 2017-02-06 18:48:38 -06:00
evazion 2d62fff89b tests: add more wiki page versions controller tests. 2017-02-06 18:48:37 -06:00
evazion 43591e0c2d tests: add more wiki pages controller tests. 2017-02-06 18:48:37 -06:00
evazion 5c871aee64 tests: add more pools controller tests. 2017-02-06 18:48:37 -06:00
evazion dfb8d0106d tests: add more posts controller tests. 2017-02-06 18:48:37 -06:00
evazion 09ffac07ea tests: add more users controller tests. 2017-02-06 18:48:37 -06:00
evazion 3edd814be5 tests: add iqdb queries controller tests. 2017-02-06 18:48:37 -06:00
evazion e26fb61ee9 tests: add explore/posts controller tests. 2017-02-06 18:48:36 -06:00
evazion 443c41cff2 tests: add meta searches controller tests. 2017-02-06 18:48:36 -06:00
evazion 30c3a52187 tests: add mod actions controller test. 2017-02-06 18:48:36 -06:00
evazion 101a03e797 tests: add related tags controller tests. 2017-02-06 18:48:36 -06:00
evazion 423dfc13b8 tests: add sources controller tests. 2017-02-06 18:48:36 -06:00
evazion 142dc05d0c tests: add note previews controller tests. 2017-02-06 18:48:35 -06:00
evazion 77b4dfcdfb tests: add artist controller tests. 2017-02-06 18:48:35 -06:00
evazion 490864e24d tests: add saved searches controller tests. 2017-02-06 18:48:35 -06:00
evazion 64b4004bbf tests: add favorite groups controller tests. 2017-02-06 18:48:35 -06:00
evazion ed451b7199 tests: add reports controller tests. 2017-02-06 18:48:35 -06:00
evazion d74503ae05 tests: add misc controller tests. 2017-02-06 18:48:35 -06: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 beddc34958 tests: set Delayed::Worker.delay_jobs = false globally. 2017-02-04 17:18:51 -06:00
evazion 3ee7f0770f Fix posts controller api test.
1) Failure:
    PostsControllerTest#test_: The posts controller for api calls passing the api limit should work. [/home/danbooru/src/danbooru/test/functional/posts_controller_test.rb:34]:
    Expected response to be a <429>, but was <200>.
    Expected: 429
      Actual: 200
2017-02-03 04:03:43 -06:00
r888888888 1207faa600 fix tests 2017-01-24 16:05:06 -08:00
evazion 66e30b323c Name changes: remove delete request button. 2017-01-15 05:03:08 +00:00
Albert Yi f2a5d45db0 implement token bucket rate limiting 2017-01-09 17:31:14 -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
evazion 0e73f3c8a9 Add tests for stickying comments. 2016-12-26 23:52:46 -06:00
Albert Yi ee4ebce4d7 support pool version archive 2016-12-21 11:43:46 -08:00
evazion a92120e873 Fix #2785: Allow changing API key; require password to view or change key. 2016-12-18 06:30:48 -06:00
Albert Yi 4eb0a64135 fix exploit for viewing private dmails 2016-12-06 14:34:46 -08: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 bba080a4c5 Test mod deletion of user feedbacks. 2016-11-28 03:57:23 -06:00
evazion 2dadad395b Add test for setting dmail filters on other people. 2016-11-12 01:10:14 -06:00
Albert Yi eb6746a8a8 additional checks on forum topic visibility 2016-11-07 10:48:04 -08:00
evazion 6a9b68022a Test /forum_posts?search[creator_id]=1. 2016-10-31 17:11:52 -05:00
evazion 4e9f7391e6 Test private topics don't bump forum. 2016-10-30 18:00:26 -05:00
evazion 88a8c02f4c Test /forum_posts doesn't list private forum topics. 2016-10-30 18:00:26 -05:00
Albert Yi 589df5f301 implements #2658: private forum topics 2016-10-24 16:56:18 -07:00