denny / ShinyCMS

ShinyCMS is an open source CMS. This is the Perl version, built with Catalyst and DBIC. (There is also a Ruby on Rails version: www.github.com/denny/ShinyCMS-ruby)
58 stars 24 forks source link

Add tests for spam/ham methods on Comment, and add safe_param util method #94

Closed denny closed 3 years ago

denny commented 3 years ago

More of a golf than a refactor; moved a lot of 'or null' fallbacks for request params into one utility method, to cut out some conditionals that weren't covered on both sides.

codecov[bot] commented 3 years ago

Codecov Report

Merging #94 (c8d6ccb) into main (b0b9110) will increase coverage by 0.17%. The diff coverage is 82.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #94      +/-   ##
==========================================
+ Coverage   88.81%   88.99%   +0.17%     
==========================================
  Files         113      113              
  Lines        5230     5232       +2     
  Branches      747      745       -2     
==========================================
+ Hits         4645     4656      +11     
+ Misses        319      312       -7     
+ Partials      266      264       -2     
Impacted Files Coverage Δ
lib/ShinyCMS/Controller/Admin/Blog.pm 82.92% <ø> (ø)
lib/ShinyCMS/Controller/Admin/Events.pm 100.00% <ø> (ø)
lib/ShinyCMS/Controller/Admin/Pages.pm 82.53% <ø> (ø)
lib/ShinyCMS/Controller/Admin/Polls.pm 100.00% <ø> (ø)
lib/ShinyCMS/Controller/Discussion.pm 75.31% <ø> (ø)
lib/ShinyCMS/Controller/Shop.pm 86.17% <ø> (ø)
lib/ShinyCMS/Controller/Admin/Newsletters.pm 82.53% <66.66%> (ø)
lib/ShinyCMS/Controller/Admin/Shop.pm 96.79% <66.66%> (ø)
lib/ShinyCMS/Controller/User.pm 83.05% <71.42%> (+0.05%) :arrow_up:
lib/ShinyCMS/Controller/Newsletters.pm 82.78% <80.00%> (+0.42%) :arrow_up:
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b0b9110...c8d6ccb. Read the comment docs.

denny commented 3 years ago

Brings schema/results back to 100% coverage as well.