fixed unit tests
This commit is contained in:
@@ -6,7 +6,7 @@ class Note < ActiveRecord::Base
|
|||||||
before_validation :initialize_creator, :on => :create
|
before_validation :initialize_creator, :on => :create
|
||||||
before_validation :initialize_updater
|
before_validation :initialize_updater
|
||||||
before_validation :blank_body
|
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"
|
has_many :versions, :class_name => "NoteVersion", :order => "note_versions.id ASC"
|
||||||
after_save :update_post
|
after_save :update_post
|
||||||
after_save :create_version
|
after_save :create_version
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ require 'test_helper'
|
|||||||
|
|
||||||
module Sources
|
module Sources
|
||||||
class PixaTest < ActiveSupport::TestCase
|
class PixaTest < ActiveSupport::TestCase
|
||||||
context "The source site for nico seiga" do
|
context "The source site for pixa" do
|
||||||
setup do
|
setup do
|
||||||
@site = Sources::Site.new("http://www.pixa.cc/illustrations/show/75575")
|
@site = Sources::Site.new("http://www.pixa.cc/illustrations/show/75575")
|
||||||
@site.get
|
@site.get
|
||||||
|
|||||||
@@ -120,9 +120,9 @@ class UploadTest < ActiveSupport::TestCase
|
|||||||
@upload.calculate_dimensions(@upload.file_path)
|
@upload.calculate_dimensions(@upload.file_path)
|
||||||
assert_nothing_raised {@upload.generate_resizes(@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(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(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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user