瀏覽代碼

change localhost to be a realistic dir in tests

Kevin Hughes 11 年之前
父節點
當前提交
eb3fbcb684
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 3 3
      test/detailed_log_subscriber_test.rb
  2. 2 2
      test/test_helper.rb

+ 3 - 3
test/detailed_log_subscriber_test.rb

@@ -10,7 +10,7 @@ class LogSubscriberTest < Test::Unit::TestCase
     @ua_header = "\"User-Agent\"=>\"ShopifyAPI/#{ShopifyAPI::VERSION} ActiveResource/#{ActiveResource::VERSION::STRING} Ruby/#{RUBY_VERSION}\""
     @ua_header = "\"User-Agent\"=>\"ShopifyAPI/#{ShopifyAPI::VERSION} ActiveResource/#{ActiveResource::VERSION::STRING} Ruby/#{RUBY_VERSION}\""
 
 
     ShopifyAPI::Base.clear_session
     ShopifyAPI::Base.clear_session
-    ShopifyAPI::Base.site = "https://localhost/admin"
+    ShopifyAPI::Base.site = "https://this-is-my-test-show.myshopify.com/admin"
 
 
     ActiveResource::LogSubscriber.attach_to :active_resource
     ActiveResource::LogSubscriber.attach_to :active_resource
     ActiveResource::DetailedLogSubscriber.attach_to :active_resource_detailed
     ActiveResource::DetailedLogSubscriber.attach_to :active_resource_detailed
@@ -26,7 +26,7 @@ class LogSubscriberTest < Test::Unit::TestCase
     ShopifyAPI::Page.find(1)
     ShopifyAPI::Page.find(1)
 
 
     assert_equal 4, @logger.logged(:info).size
     assert_equal 4, @logger.logged(:info).size
-    assert_equal "GET https://localhost:443/admin/pages/1.json",                  @logger.logged(:info)[0]
+    assert_equal "GET https://this-is-my-test-show.myshopify.com:443/admin/pages/1.json",                  @logger.logged(:info)[0]
     assert_match /\-\-\> 200/,                                                  @logger.logged(:info)[1]
     assert_match /\-\-\> 200/,                                                  @logger.logged(:info)[1]
     assert_equal "Headers: {\"Accept\"=>\"application/json\", #{@ua_header}}",  @logger.logged(:info)[2]
     assert_equal "Headers: {\"Accept\"=>\"application/json\", #{@ua_header}}",  @logger.logged(:info)[2]
     assert_match /Response:\n\{\"page\"\:\{((\"id\"\:1)|(\"title\"\:\"Shopify API\")),((\"id\"\:1)|(\"title\"\:\"Shopify API\"))\}\}/,  @logger.logged(:info)[3]
     assert_match /Response:\n\{\"page\"\:\{((\"id\"\:1)|(\"title\"\:\"Shopify API\")),((\"id\"\:1)|(\"title\"\:\"Shopify API\"))\}\}/,  @logger.logged(:info)[3]
@@ -41,7 +41,7 @@ class LogSubscriberTest < Test::Unit::TestCase
     end
     end
 
 
     assert_equal 4, @logger.logged(:info).size
     assert_equal 4, @logger.logged(:info).size
-    assert_equal "GET https://localhost:443/admin/pages/2.json",  @logger.logged(:info)[0]
+    assert_equal "GET https://this-is-my-test-show.myshopify.com:443/admin/pages/2.json",  @logger.logged(:info)[0]
     assert_match /\-\-\> 404/,                                  @logger.logged(:info)[1]
     assert_match /\-\-\> 404/,                                  @logger.logged(:info)[1]
     assert_equal "Headers: {\"Accept\"=>\"application/json\", #{@ua_header}}", @logger.logged(:info)[2]
     assert_equal "Headers: {\"Accept\"=>\"application/json\", #{@ua_header}}", @logger.logged(:info)[2]
     assert_equal "Response:",                                   @logger.logged(:info)[3]
     assert_equal "Response:",                                   @logger.logged(:info)[3]

+ 2 - 2
test/test_helper.rb

@@ -35,7 +35,7 @@ class Test::Unit::TestCase
     end
     end
 
 
     ShopifyAPI::Base.clear_session
     ShopifyAPI::Base.clear_session
-    ShopifyAPI::Base.site = "https://localhost/admin"
+    ShopifyAPI::Base.site = "https://this-is-my-test-show.myshopify.com/admin"
     ShopifyAPI::Base.password = nil
     ShopifyAPI::Base.password = nil
     ShopifyAPI::Base.user = nil
     ShopifyAPI::Base.user = nil
   end
   end
@@ -62,7 +62,7 @@ class Test::Unit::TestCase
     url = if options.has_key?(:url)
     url = if options.has_key?(:url)
       options[:url]
       options[:url]
     else
     else
-      "https://localhost/admin/#{endpoint}#{extension}"
+      "https://this-is-my-test-show.myshopify.com/admin/#{endpoint}#{extension}"
     end
     end
 
 
     FakeWeb.register_uri(method, url, {:body => body, :status => 200, :content_type => "text/#{format}", :content_length => 1}.merge(options))
     FakeWeb.register_uri(method, url, {:body => body, :status => 200, :content_type => "text/#{format}", :content_length => 1}.merge(options))