Fixes and testing for class proxy
This commit is contained in:
parent
061c7a0154
commit
9f1eea8d32
|
@ -51,7 +51,7 @@ module CouchRest
|
|||
elsif m.to_s =~ /^find_(by_.+)/
|
||||
view_name = $1
|
||||
if has_view?(view_name)
|
||||
return find_first_from_view(view_name, *args)
|
||||
return first_from_view(view_name, *args)
|
||||
end
|
||||
end
|
||||
super
|
||||
|
|
|
@ -60,6 +60,10 @@ describe "Proxy Class" do
|
|||
@us.first_from_view('by_title', 'bbb', :limit => 1)
|
||||
end
|
||||
|
||||
it "should allow dynamic view matching for single elements" do
|
||||
@us.should_receive(:first_from_view).with('by_title', 'bbb')
|
||||
@us.find_by_title('bbb')
|
||||
end
|
||||
|
||||
it "should yield" do
|
||||
things = []
|
||||
|
|
Loading…
Reference in a new issue