diff --git a/script/fixes/006.rb b/script/fixes/006.rb index aee434997..190b663ff 100644 --- a/script/fixes/006.rb +++ b/script/fixes/006.rb @@ -15,7 +15,7 @@ Post.where("created_at > '2013-02-01'").find_each do |post| post.update_column(:tag_count_character, post.tag_count_character) end -PoolVersion.where("post_ids like '% 6 %'").find_each do |pool_version| +PoolVersion.where("post_ids like '% 4 %' and post_ids like '% 8 %' and post_ids like '% 9 %' and post_ids like '% 11 %'").find_each do |pool_version| cleaned_post_ids = pool_version.post_ids.scan(/(\d+) \d+/).join(" ") pool_version.update_column(:post_ids, cleaned_post_ids) end; true diff --git a/test/functional/posts_controller_test.rb b/test/functional/posts_controller_test.rb index 69605690a..1824ff1da 100644 --- a/test/functional/posts_controller_test.rb +++ b/test/functional/posts_controller_test.rb @@ -44,7 +44,7 @@ class PostsControllerTest < ActionController::TestCase @basic_auth_string = "Basic #{::Base64.encode64("#{@user.name}:badpassword")}" @request.env['HTTP_AUTHORIZATION'] = @basic_auth_string get :index, {:format => "json"} - assert_response 401 + assert_response 403 end end @@ -56,7 +56,7 @@ class PostsControllerTest < ActionController::TestCase should "fail for password mismatches" do get :index, {:format => "json", :login => @user.name, :api_key => "bad"} - assert_response 401 + assert_response 403 end end @@ -68,7 +68,7 @@ class PostsControllerTest < ActionController::TestCase should "fail for password mismatches" do get :index, {:format => "json", :login => @user.name, :password_hash => "bad"} - assert_response 401 + assert_response 403 end end end