diff --git a/app/controllers/bulk_update_requests_controller.rb b/app/controllers/bulk_update_requests_controller.rb index d3b11fa7c..036f3a10c 100644 --- a/app/controllers/bulk_update_requests_controller.rb +++ b/app/controllers/bulk_update_requests_controller.rb @@ -44,7 +44,7 @@ class BulkUpdateRequestsController < ApplicationController end def index - @bulk_update_requests = BulkUpdateRequest.search(params[:search]).order("(case status when 'pending' then 0 when 'approved' then 1 else 2 end), id desc").paginate(params[:page], :limit => params[:limit]) + @bulk_update_requests = BulkUpdateRequest.paginate(params[:page]) respond_with(@bulk_update_requests) end diff --git a/app/logical/downloads/strategies/pixiv.rb b/app/logical/downloads/strategies/pixiv.rb index e32974cfa..9f722da18 100644 --- a/app/logical/downloads/strategies/pixiv.rb +++ b/app/logical/downloads/strategies/pixiv.rb @@ -34,7 +34,7 @@ module Downloads if url =~ %r!(/img/.+?/.+?)_m.+$! match = $1 url.sub!(match + "_m", match) - elsif url =~ %r!(/img/.+?/.+?)_s.+$! && url !~ %r!/img-inf/! + elsif url !~ %r!/img-inf/! && url =~ %r!(/img/.+?/.+?)_s.+$! match = $1 url.sub!(match + "_s", match) end diff --git a/app/models/dmail.rb b/app/models/dmail.rb index b85deb9a2..d842cb122 100644 --- a/app/models/dmail.rb +++ b/app/models/dmail.rb @@ -188,12 +188,12 @@ class Dmail < ActiveRecord::Base update_column(:is_read, true) unless Dmail.where(:is_read => false, :owner_id => CurrentUser.user.id).exists? - CurrentUser.user.update_column(:has_mail, false) + CurrentUser.user.update_attribute(:has_mail, false) end end def update_recipient - to.update_column(:has_mail, true) + to.update_attribute(:has_mail, true) end def visible_to?(user) diff --git a/test/factories/bulk_update_request.rb b/test/factories/bulk_update_request.rb index 1e3cb56bc..6d63e1c0d 100644 --- a/test/factories/bulk_update_request.rb +++ b/test/factories/bulk_update_request.rb @@ -1,5 +1,6 @@ FactoryGirl.define do factory(:bulk_update_request) do |f| + title "xxx" script "create alias aaa -> bbb" end end diff --git a/test/functional/bulk_update_requests_controller_test.rb b/test/functional/bulk_update_requests_controller_test.rb index 42bb05986..74d1357dd 100644 --- a/test/functional/bulk_update_requests_controller_test.rb +++ b/test/functional/bulk_update_requests_controller_test.rb @@ -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 diff --git a/test/functional/forum_topics_controller_test.rb b/test/functional/forum_topics_controller_test.rb index 1fd201dd2..2f0c65204 100644 --- a/test/functional/forum_topics_controller_test.rb +++ b/test/functional/forum_topics_controller_test.rb @@ -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 diff --git a/test/unit/forum_topic_test.rb b/test/unit/forum_topic_test.rb index 99ff55381..3ec43074c 100644 --- a/test/unit/forum_topic_test.rb +++ b/test/unit/forum_topic_test.rb @@ -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 diff --git a/test/unit/saved_search_test.rb b/test/unit/saved_search_test.rb index cbf0ff109..80a8c8ba9 100644 --- a/test/unit/saved_search_test.rb +++ b/test/unit/saved_search_test.rb @@ -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 diff --git a/test/unit/upload_test.rb b/test/unit/upload_test.rb index b72a853a4..0fd39a8f1 100644 --- a/test/unit/upload_test.rb +++ b/test/unit/upload_test.rb @@ -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