From 4cfe8faae9070251ad0ec2f6bbef90df327a2519 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 11 May 2012 16:51:26 -0400 Subject: [PATCH] fixed unit tests --- app/models/note.rb | 2 +- test/unit/sources/pixa_test.rb | 2 +- test/unit/upload_test.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/note.rb b/app/models/note.rb index b3ec54596..bd7e797fb 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -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 diff --git a/test/unit/sources/pixa_test.rb b/test/unit/sources/pixa_test.rb index 34c776e1b..232caf4d2 100644 --- a/test/unit/sources/pixa_test.rb +++ b/test/unit/sources/pixa_test.rb @@ -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 diff --git a/test/unit/upload_test.rb b/test/unit/upload_test.rb index 41f089ecd..37b05f405 100644 --- a/test/unit/upload_test.rb +++ b/test/unit/upload_test.rb @@ -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