Skip to content

Commit

Permalink
when searching a open search tells which type is accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermesilveira committed Oct 24, 2010
1 parent 7c48b34 commit 9e7e7b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/restfulie/common/converter/open_search/descriptor.rb
Expand Up @@ -16,7 +16,7 @@ def use(content_type)
return nil if uri.nil?

base_uri, params_pattern = extract_uri(uri)
Restfulie.at(base_uri).open_search.with_pattern(params_pattern)
Restfulie.at(base_uri).accepts(content_type).open_search.with_pattern(params_pattern)
end

private
Expand Down
1 change: 1 addition & 0 deletions spec/unit/common/converter/opensearch/descriptor_spec.rb
Expand Up @@ -20,6 +20,7 @@
@descriptor.urls.size.should == 1
@descriptor.use("application/atom+xml").host.should == URI.parse("http://localhost:3000/products")
@descriptor.use("application/atom+xml").params_pattern.should == "q={searchTerms}&pw={startPage?}&format=atom"
@descriptor.use("application/atom+xml").headers["Accept"].should == "application/atom+xml"
end

end
Expand Down

0 comments on commit 9e7e7b5

Please sign in to comment.