fixed unit tests

This commit is contained in:
albert
2012-05-11 16:51:26 -04:00
parent 5b557a418a
commit 4cfe8faae9
3 changed files with 4 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ class Note < ActiveRecord::Base
before_validation :initialize_creator, :on => :create
before_validation :initialize_updater
before_validation :blank_body
validates_presence_of :post_id, :creator_id, :updater_id
validates_presence_of :post_id, :creator_id, :updater_id, :x, :y, :width, :height
has_many :versions, :class_name => "NoteVersion", :order => "note_versions.id ASC"
after_save :update_post
after_save :create_version

View File

@@ -4,7 +4,7 @@ require 'test_helper'
module Sources
class PixaTest < ActiveSupport::TestCase
context "The source site for nico seiga" do
context "The source site for pixa" do
setup do
@site = Sources::Site.new("http://www.pixa.cc/illustrations/show/75575")
@site.get

View File

@@ -120,9 +120,9 @@ class UploadTest < ActiveSupport::TestCase
@upload.calculate_dimensions(@upload.file_path)
assert_nothing_raised {@upload.generate_resizes(@upload.file_path)}
assert(File.exists?(@upload.resized_file_path_for(Danbooru.config.small_image_width)))
assert_equal(10639, File.size(@upload.resized_file_path_for(Danbooru.config.small_image_width)))
assert_equal(6197, File.size(@upload.resized_file_path_for(Danbooru.config.small_image_width)))
assert(File.exists?(@upload.resized_file_path_for(Danbooru.config.large_image_width)))
assert_equal(129472, File.size(@upload.resized_file_path_for(Danbooru.config.large_image_width)))
assert_equal(117877, File.size(@upload.resized_file_path_for(Danbooru.config.large_image_width)))
end
end