Skip to content

Commit

Permalink
add a spec for a field with single quote
Browse files Browse the repository at this point in the history
  • Loading branch information
siuying committed Dec 17, 2012
1 parent 17f4bed commit e133e94
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/finder_spec.rb
Expand Up @@ -129,6 +129,17 @@ def stub_user(name, age, created_at)
user.class.should == User user.class.should == User
end end


it "find object with quote" do
stub_user("Bob'd", 49, Time.now).save

users = User.find(:name, NSFEqualTo, "Bob'd")
users.size.should == 1

user = users.first
user.name.should == "Bob'd"
user.class.should == User
end

it "only return objects of the class" do it "only return objects of the class" do
car = Car.create(:name => "Honda") car = Car.create(:name => "Honda")
Car.find.size.should == 1 Car.find.size.should == 1
Expand Down

0 comments on commit e133e94

Please sign in to comment.