Quellcode durchsuchen

Rails 3 fix: attribute_accessors has to be explicitly included since activesupport 3.0.0

Dennis Theisen vor 14 Jahren
Ursprung
Commit
30927cd63c
2 geänderte Dateien mit 11 neuen und 0 gelöschten Zeilen
  1. 1 0
      lib/shopify_api.rb
  2. 10 0
      test/shopify_api_test.rb

+ 1 - 0
lib/shopify_api.rb

@@ -1,4 +1,5 @@
 require 'active_resource'
+require 'active_support/core_ext/class/attribute_accessors'
 require 'digest/md5'
 
 module ShopifyAPI

+ 10 - 0
test/shopify_api_test.rb

@@ -29,5 +29,15 @@ class ShopifyApiTest < Test::Unit::TestCase
         session = ShopifyAPI::Session.new("testshop.myshopify.com", "any-token", {'foo' => 'bar'})
       end
     end
+
+    should "setup api_key and secret for all sessions" do
+      ShopifyAPI::Session.setup(:api_key => "My test key", :secret => "My test secret")
+      assert_equal "My test key", ShopifyAPI::Session.api_key
+      assert_equal "My test secret", ShopifyAPI::Session.secret
+    end
+    
+    should "use 'https' protocol by default for all sessions" do
+      assert_equal 'https', ShopifyAPI::Session.protocol
+    end
   end
 end