Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reverting the changes made by #25

- ActiveResource does not play nice
  • Loading branch information...
commit 2dd0bc236d965f8313ab74401162e1119f5bec6b 1 parent f88db58
@shayfrendt shayfrendt authored
Showing with 11 additions and 28 deletions.
  1. +1 −5 lib/chargify_api_ares.rb
  2. +10 −23 spec/base_spec.rb
View
6 lib/chargify_api_ares.rb
@@ -61,11 +61,7 @@ def configure
Base.password = 'X'
Base.timeout = timeout unless (timeout.blank?)
- if site.to_s != Base.site.to_s
- self.site = site || "https://#{subdomain}.chargify.com"
- else
- self.site = "https://#{subdomain}.chargify.com"
- end
+ self.site ||= "https://#{subdomain}.chargify.com"
Base.site = site
Subscription::Component.site = site + "/subscriptions/:subscription_id"
View
33 spec/base_spec.rb
@@ -12,29 +12,16 @@
@original_subdomain = Chargify.subdomain
end
- it "honors changes made after the first configuration" do
- expect do
- Chargify.configure do |c|
- c.subdomain = "something-new"
- end
- end.to change { Chargify::Base.site.to_s }.to("https://something-new.chargify.com")
- end
-
- it "honors changes made to the subdomain" do
- Chargify.configure do |c|
- c.subdomain = "grizzly-bear"
- c.api_key = "abc123"
- end
-
- Chargify.site.should == "https://grizzly-bear.chargify.com"
-
- Chargify.configure do |c|
- c.subdomain = "zebra"
- c.api_key = "abc123"
- end
-
- Chargify.site.should == "https://zebra.chargify.com"
- end
+ # TODO: Because ActiveResource overloads the word "site"
+ # It is difficult to support setting either the site or subdomain
+ # after the class has already been configured and loaded
+ # it "honors changes made after the first configuration" do
+ # expect do
+ # Chargify.configure do |c|
+ # c.subdomain = "something-new"
+ # end
+ # end.to change { Chargify::Base.site.to_s }.to("https://something-new.chargify.com")
+ # end
it "honors the site over the subdomain if it is specified" do
expect do

0 comments on commit 2dd0bc2

Please sign in to comment.
Something went wrong with that request. Please try again.