0
# Delete the database last
0
ActiveCouch::Migrator.delete_database('http://localhost:5984', 'people')
0
+ Object.send(:remove_const, :Person)
0
it "should respond to the find method" do
0
describe "ActiveCouch::Base #find method with multiple documents in the CouchDB database" do
0
class Person < ActiveCouch::Base
0
# Delete the database last
0
- ActiveCouch::Migrator.delete_database('http://localhost:5984', 'people')
0
+ ActiveCouch::Migrator.delete_database('http://localhost:5984', 'people')
0
+ Object.send(:remove_const, :Person)
0
it "should find all objects in the database when find method is sent the param :all" do
0
# Create the database first
0
ActiveCouch::Migrator.delete_database('http://localhost:5984', 'blogs')
0
+ Object.send(:remove_const, :Blog)
0
+ Object.send(:remove_const, :Comment)
0
it "should be able to retrieve the simple attributes" do
0
(blog.comments.inspect =~ /ya rly!/).should_not == nil
0
+describe "ActiveCouch::Base #find method with no params passed" do
0
+ class Person < ActiveCouch::Base
0
+ site 'http://localhost:5984/'
0
+ # Define the migration
0
+ class ByName < ActiveCouch::Migration
0
+ define :for_db => 'people' do
0
+ # Create the database first
0
+ ActiveCouch::Migrator.create_database('http://localhost:5984', 'people')
0
+ ActiveCouch::Migrator.migrate('http://localhost:5984', ByName)
0
+ Person.create(:name => 'McLovin')
0
+ Person.create(:name => 'Seth')
0
+ # Delete the database last
0
+ ActiveCouch::Migrator.delete_database('http://localhost:5984', 'people')
0
+ Object.send(:remove_const, :Person)
0
+ it "should return all documents if passed :all, with no params specified"
0
+describe "ActiveCouch::Base #find method with an ID passed" do
0
+ class Person < ActiveCouch::Base
0
+ site 'http://localhost:5984/'
0
+ # Define the migration
0
+ class ByName < ActiveCouch::Migration
0
+ define :for_db => 'people' do
0
+ # Create the database first
0
+ ActiveCouch::Migrator.create_database('http://localhost:5984', 'people')
0
+ ActiveCouch::Migrator.migrate('http://localhost:5984', ByName)
0
+ Person.create(:name => 'McLovin', :id => '123')
0
+ # Delete the database last
0
+ ActiveCouch::Migrator.delete_database('http://localhost:5984', 'people')
0
+ Object.send(:remove_const, :Person)
0
+ it "should return an ActiveCouch::Base object if the ID exists" do
0
+ person = Person.find('123')
0
+ person.name.should == 'McLovin'
0
+ it "should return nil if the ID does not exist" do
0
+ person = Person.find('321')