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