fixed tests

This commit is contained in:
albert
2013-03-18 03:26:02 -04:00
parent 04b18abc6e
commit d21c4500d2
5 changed files with 14 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
<% content_for(:secondary_links) do %>
<menu>
<li><%= render "quick_search" %></li>
<li><%= render "artists/quick_search" %></li>
<li><%= link_to "Listing", artists_path %></li>
<li><%= link_to "Banned", banned_artists_path %></li>
<li><%= link_to "Search", search_artists_path %></li>

View File

@@ -18,7 +18,7 @@ every 1.day, :at => "1:00 am" do
command "cd /var/www/danbooru2/current ; script/donmai/prune_backup_dbs"
end
every 1.day, :at => "2:00 am" do
every 8.hours do
command "psql --set statement_timeout=0 -hdbserver -c \"vacuum analyze;\" danbooru2"
end

View File

@@ -2250,8 +2250,6 @@ CREATE TABLE posts (
id integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
up_score integer DEFAULT 0 NOT NULL,
down_score integer DEFAULT 0 NOT NULL,
score integer DEFAULT 0 NOT NULL,
source character varying(255),
md5 character varying(255) NOT NULL,
@@ -6256,4 +6254,6 @@ INSERT INTO schema_migrations (version) VALUES ('20130318002652');
INSERT INTO schema_migrations (version) VALUES ('20130318012517');
INSERT INTO schema_migrations (version) VALUES ('20130318030619');
INSERT INTO schema_migrations (version) VALUES ('20130318030619');
INSERT INTO schema_migrations (version) VALUES ('20130318031705');

View File

@@ -50,16 +50,5 @@ class TagAliasesControllerTest < ActionController::TestCase
end
end
end
context "destroy_cache action" do
setup do
@tag_alias = FactoryGirl.create(:tag_alias, :antecedent_name => "aaa")
end
should "reset the cache" do
post :cache, {:id => @tag_alias.id}, {:user_id => @user.id}
assert_nil(Cache.get("ta:aaa"))
end
end
end
end

View File

@@ -92,20 +92,20 @@ class ArtistTest < ActiveSupport::TestCase
end
should "find matches by url" do
a1 = FactoryGirl.create(:artist, :name => "rembrandt", :url_string => "http://rembrandt.com/test.jpg")
a2 = FactoryGirl.create(:artist, :name => "subway", :url_string => "http://subway.com/test.jpg")
a3 = FactoryGirl.create(:artist, :name => "minko", :url_string => "https://minko.com/test.jpg")
a1 = FactoryGirl.create(:artist, :name => "rembrandt", :url_string => "http://rembrandt.com/x/test.jpg")
a2 = FactoryGirl.create(:artist, :name => "subway", :url_string => "http://subway.com/x/test.jpg")
a3 = FactoryGirl.create(:artist, :name => "minko", :url_string => "https://minko.com/x/test.jpg")
assert_equal(["rembrandt"], Artist.find_all_by_url("http://rembrandt.com/test.jpg").map(&:name))
assert_equal(["rembrandt"], Artist.find_all_by_url("http://rembrandt.com/another.jpg").map(&:name))
assert_equal(["rembrandt"], Artist.find_all_by_url("http://rembrandt.com/x/test.jpg").map(&:name))
assert_equal(["rembrandt"], Artist.find_all_by_url("http://rembrandt.com/x/another.jpg").map(&:name))
assert_equal([], Artist.find_all_by_url("http://nonexistent.com/test.jpg").map(&:name))
assert_equal(["minko"], Artist.find_all_by_url("https://minko.com/test.jpg").map(&:name))
assert_equal(["minko"], Artist.find_all_by_url("http://minko.com/test.jpg").map(&:name))
assert_equal(["minko"], Artist.find_all_by_url("https://minko.com/x/test.jpg").map(&:name))
assert_equal(["minko"], Artist.find_all_by_url("http://minko.com/x/test.jpg").map(&:name))
end
should "not allow duplicates" do
FactoryGirl.create(:artist, :name => "warhol", :url_string => "http://warhol.com/a/image.jpg\nhttp://warhol.com/b/image.jpg")
assert_equal(["warhol"], Artist.find_all_by_url("http://warhol.com/test.jpg").map(&:name))
FactoryGirl.create(:artist, :name => "warhol", :url_string => "http://warhol.com/x/a/image.jpg\nhttp://warhol.com/x/b/image.jpg")
assert_equal(["warhol"], Artist.find_all_by_url("http://warhol.com/x/test.jpg").map(&:name))
end
should "hide deleted artists" do