fix tests

This commit is contained in:
r888888888
2014-06-18 16:51:55 -07:00
parent f02f72fac1
commit f65691b5e6
9 changed files with 12 additions and 12 deletions

View File

@@ -1,5 +1,6 @@
FactoryGirl.define do
factory(:bulk_update_request) do |f|
title "xxx"
script "create alias aaa -> bbb"
end
end

View File

@@ -17,7 +17,7 @@ class BulkUpdateRequestsControllerTest < ActionController::TestCase
context "#create" do
should "succeed" do
assert_difference("BulkUpdateRequest.count", 1) do
post :create, {:bulk_update_request => {:script => "create alias aaa -> bbb"}}, {:user_id => @user.id}
post :create, {:bulk_update_request => {:script => "create alias aaa -> bbb", :title => "xxx"}}, {:user_id => @user.id}
end
end
end

View File

@@ -30,7 +30,7 @@ class ForumTopicsControllerTest < ActionController::TestCase
should "truncate" do
get :show, {:id => @forum_topic.id}, {:user_id => @user.id, :read_forum_topics => @cookie_data}
assert_response :success
assert_equal(1570, session[:read_forum_topics].size)
assert_equal(395, session[:read_forum_topics].size)
end
end
end

View File

@@ -110,7 +110,7 @@ class ForumTopicTest < ActiveSupport::TestCase
should "prune the string if it gets too long" do
array = (1..1_000).to_a.map(&:to_s).in_groups_of(2)
result = @topic.mark_as_read(array)
assert_operator result.size, :<, 500
assert_operator result.size, :<=, 500
end
end

View File

@@ -9,7 +9,7 @@ class SavedSearchTest < ActiveSupport::TestCase
should "update the bitpref on the user" do
@user.reload
assert(@user.has_saved_searchs?, "should have saved_searches bitpref set")
assert(@user.has_saved_searches?, "should have saved_searches bitpref set")
end
end
@@ -34,7 +34,7 @@ class SavedSearchTest < ActiveSupport::TestCase
end
should "not be able to create another saved search" do
assert_equal(["User can only have up to 0 saved searches"], @saved_search.errors.full_messages)
assert_equal(["You can only have up to 0 saved searches"], @saved_search.errors.full_messages)
end
end
end

View File

@@ -175,10 +175,9 @@ class UploadTest < ActiveSupport::TestCase
should "increment the uploaders post_upload_count" do
@upload = FactoryGirl.create(:source_upload)
assert_difference("CurrentUser.post_upload_count", 1) do
assert_difference("CurrentUser.user.post_upload_count", 1) do
@upload.process!
puts @upload.errors.full_messages
CurrentUser.reload
CurrentUser.user.reload
end
end