Merge pull request #2878 from evazion/fix-test-coverage
Improve controller test coverage
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
module Admin
|
||||
class DashboardsController < ApplicationController
|
||||
before_filter :admin_only
|
||||
|
||||
def show
|
||||
@dashboard = AdminDashboard.new
|
||||
end
|
||||
|
||||
@@ -12,6 +12,6 @@ class AdminDashboard
|
||||
end
|
||||
|
||||
def forum_topics
|
||||
ForumTopic.where(category_id: 1).order("id desc").limit(20)
|
||||
ForumTopic.search(category_id: 1).order("id desc").limit(20)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -120,7 +120,7 @@ class FavoriteGroup < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def initialize_creator
|
||||
self.creator_id = CurrentUser.id
|
||||
self.creator_id ||= CurrentUser.id
|
||||
end
|
||||
|
||||
def strip_name
|
||||
@@ -214,6 +214,7 @@ class FavoriteGroup < ActiveRecord::Base
|
||||
super
|
||||
@neighbor_posts = nil
|
||||
clear_post_id_array
|
||||
self
|
||||
end
|
||||
|
||||
def last_page
|
||||
|
||||
@@ -94,7 +94,7 @@ class Note < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def initialize_creator
|
||||
self.creator_id = CurrentUser.id
|
||||
self.creator_id ||= CurrentUser.id
|
||||
end
|
||||
|
||||
def initialize_updater
|
||||
|
||||
@@ -173,7 +173,7 @@ class Post < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def is_animated_png?
|
||||
if file_ext =~ /png/i
|
||||
if file_ext =~ /png/i && File.exists?(file_path)
|
||||
apng = APNGInspector.new(file_path)
|
||||
apng.inspect!
|
||||
return apng.animated?
|
||||
|
||||
Reference in New Issue
Block a user