Permalink
Browse files

Fixed failing see also test

  • Loading branch information...
zk committed Oct 11, 2010
1 parent d262bc0 commit 03cb2ea1d4647202e40ba79534debfd8b641b97d
@@ -45,14 +45,15 @@ def vote
def lookup
l = params[:library]
q = params[:term]
- version = Library.find_by_name_and_current(l, true).version
+ version = Library.find_by_name_and_current(l, true).version rescue nil
if not q
render :json => []
return
end
name = q + "%"
+
@functions = Function.find(:all, :conditions => ['name like ? and version = ?', name, version]).sort{|a,b| Levenshtein.distance(q, a.name) <=> Levenshtein.distance(q, b.name)}.uniq
if @functions.size > 10
@@ -61,6 +61,7 @@ f should accept number-of-colls arguments.\"
created_at: 2010-07-14 20:22:06
updated_at: 2010-07-21 02:31:05
shortdoc: Returns a lazy sequence consisting of the result of applying f to the
+ version: "1.2.0"
dummy:
id: 2
@@ -9,6 +9,7 @@
clojure_core:
id: 1
library_id: 1
+ version: "1.2.0"
name: clojure.core
doc: "Fundamental library of the Clojure language"
@@ -1,5 +1,5 @@
require 'test_helper'
class ManagementControllerTest < ActionController::TestCase
- should_succeed :index, :lib => 'Clojure Core'
+ should_succeed :index, :lib => 'clojure_core'
end
@@ -103,7 +103,7 @@ class SeeAlsoControllerTest < ActionController::TestCase
context "with a query matching an existing var name" do
setup do
- get :lookup, :term => 'ma'
+ get :lookup, :term => 'ma', :library => 'Clojure Core'
end
should "respond with the map var" do

0 comments on commit 03cb2ea

Please sign in to comment.