Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update UrlShortener::Client#expand to return the

UrlShortener::Response::Expand object and update feature
  • Loading branch information...
commit 6719eef1fa1dff6cb70d0c3916b72f0232b1d8f5 1 parent 089c0e4
nas authored
View
2  features/step_definitions/api_call_steps.rb
@@ -59,7 +59,7 @@
end
Then /^the expanded url should be "([^\"]*)" for "([^\"]*)"$/ do |expanded_url, request_parameter|
- @response.result[request_parameter]['longUrl'].should eql(expanded_url)
+ @response.url.should eql(expanded_url)
end
Then /^the result should have "([^\"]*)" and "([^\"]*)" keys in the returned hash$/ do |key1,key2|
View
2  lib/url_shortener/client.rb
@@ -25,7 +25,7 @@ def shorten(*urls)
def expand(option)
check_request_parameters(option)
response = interface(nil, endpoint_with_options('expand',option)).get
- UrlShortener::Response.new(response)
+ UrlShortener::Response::Expand.new(response)
end
# Provide parameter as a key value pair of existing short url or its hash
View
4 spec/url_shortener/client_spec.rb
@@ -230,6 +230,10 @@
@client.expand(:shortUrl => @short_url).result['wesSD'].values.should include('http://www.goog.com')
end
+ it "should return the UrlShortener::Response::Expand object" do
+ @client.expand(:hash => @hash).should be_instance_of(UrlShortener::Response::Expand)
+ end
+
end
end

0 comments on commit 6719eef

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