remove usage of vcr cassettes; delete unused fixtures; fix some broken unit tests

This commit is contained in:
Albert Yi
2016-12-28 15:43:52 -08:00
parent b2296cab70
commit 0ea7d78584
110 changed files with 182 additions and 113327 deletions

View File

@@ -2,9 +2,7 @@ require 'test_helper'
class ArtistsControllerTest < ActionController::TestCase
def assert_artist_found(expected_artist, source_url)
VCR.use_cassette("artist-controller-test/#{Digest::SHA1.hexdigest(source_url)}", :record => @vcr_record_option) do
get :finder, { :format => :json, :url => source_url }, { :user_id => @user.id }
end
get :finder, { :format => :json, :url => source_url }, { :user_id => @user.id }
assert_response :success
assert_equal(1, assigns(:artists).size, "Testing URL: #{source_url}")
@@ -12,20 +10,12 @@ class ArtistsControllerTest < ActionController::TestCase
end
def assert_artist_not_found(source_url)
VCR.use_cassette("artist-controller-test/#{Digest::SHA1.hexdigest(source_url)}", :record => @vcr_record_option) do
get :finder, { :format => :json, :url => source_url }, { :user_id => @user.id }
end
get :finder, { :format => :json, :url => source_url }, { :user_id => @user.id }
assert_response :success
assert_equal(0, assigns(:artists).size, "Testing URL: #{source_url}")
end
def setup
super
@record = false
setup_vcr
end
context "An artists controller" do
setup do
CurrentUser.user = FactoryGirl.create(:user)
@@ -87,9 +77,7 @@ class ArtistsControllerTest < ActionController::TestCase
should "find artists by page URL" do
url = "http://www.pixiv.net/member_illust.php?mode=medium&illust_id=46170939"
VCR.use_cassette("artist-controller-test/#{Digest::SHA1.hexdigest(url)}", :record => @vcr_record_option) do
get :index, { :name => url }
end
get :index, { :name => url }
assert_response :success
assert_equal(1, assigns(:artists).size)

View File

@@ -1,10 +1,12 @@
require 'test_helper'
require 'helpers/iqdb_test_helper'
class UploadsControllerTest < ActionController::TestCase
include IqdbTestHelper
def setup
super
@record = false
setup_vcr
mock_iqdb_service!
end
context "The uploads controller" do
@@ -22,9 +24,7 @@ class UploadsControllerTest < ActionController::TestCase
context "batch action" do
context "for twitter galleries" do
should "render" do
VCR.use_cassette("upload-controller-test/twitter-batch", :record => @vcr_record_option) do
get :batch, {:url => "https://twitter.com/lvlln/status/567054278486151168"}, {:user_id => @user.id}
end
get :batch, {:url => "https://twitter.com/lvlln/status/567054278486151168"}, {:user_id => @user.id}
assert_response :success
end
end
@@ -38,9 +38,7 @@ class UploadsControllerTest < ActionController::TestCase
context "for a twitter post" do
setup do
VCR.use_cassette("upload-controller-test/twitter", :record => @vcr_record_option) do
get :new, {:url => "https://twitter.com/frappuccino/status/566030116182949888"}, {:user_id => @user.id}
end
get :new, {:url => "https://twitter.com/frappuccino/status/566030116182949888"}, {:user_id => @user.id}
end
should "render" do