Kaynağa Gözat

add test to cover the clear_session changes

Oren Mazor 8 yıl önce
ebeveyn
işleme
bb19b5aa84
1 değiştirilmiş dosya ile 13 ekleme ve 0 silme
  1. 13 0
      test/base_test.rb

+ 13 - 0
test/base_test.rb

@@ -24,6 +24,19 @@ class BaseTest < Test::Unit::TestCase
     assert_equal 'token1', ShopifyAPI::Shop.headers['X-Shopify-Access-Token']
   end
 
+  test '#clear_session should clear base site settings from Base' do
+    ShopifyAPI::Base.site = "https://foo:bar@www.zombo.com"
+
+    assert_equal "foo", ShopifyAPI::Base.user
+    assert_equal "bar", ShopifyAPI::Base.password
+
+    ShopifyAPI::Base.clear_session
+
+    assert_equal nil, ShopifyAPI::Base.user
+    assert_equal nil, ShopifyAPI::Base.password
+    assert_equal nil, ShopifyAPI::Base.site
+  end
+
   test '#clear_session should clear site and headers from Base' do
     ShopifyAPI::Base.activate_session @session1
     ShopifyAPI::Base.clear_session