Permalink
Browse files

Test the blank API request bundler now makes.

  • Loading branch information...
1 parent 3201e97 commit 4148d847c15320ad048c2afe04a3bb5a10351e4a @tomlea committed Apr 9, 2013
Showing with 6 additions and 1 deletion.
  1. +1 −1 lib/geminabox.rb
  2. +5 −0 test/integration/dependency_api/dependencies_api_test.rb
View
@@ -55,7 +55,7 @@ def fixup_bundler_rubygems!
end
get '/api/v1/dependencies' do
- query_gems = (params[:gems] or '').split(',')
+ query_gems = params[:gems].to_s.split(',')
deps = query_gems.inject([]){|memo, query_gem| memo + gem_dependencies(query_gem) }
Marshal.dump(deps)
end
@@ -65,6 +65,11 @@ class DependenciesApiTest < Geminabox::TestCase
assert_equal expected, deps
end
+ test "dependency api with empty params" do
+ deps = Marshal.load HTTPClient.new.get_content(url_for("api/v1/dependencies"))
+ assert_equal [], deps
+ end
+
protected
def fetch_deps(*gems)
Marshal.load HTTPClient.new.get_content(url_for("api/v1/dependencies?gems=#{gems.join(",")}"))

0 comments on commit 4148d84

Please sign in to comment.