Permalink
Browse files

add a spec for a field with single quote

  • Loading branch information...
1 parent 17f4bed commit e133e944877f3d11eab99dfe5ad7cdf678dee965 @siuying committed Dec 17, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 spec/finder_spec.rb
View
@@ -129,6 +129,17 @@ def stub_user(name, age, created_at)
user.class.should == User
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
car = Car.create(:name => "Honda")
Car.find.size.should == 1

0 comments on commit e133e94

Please sign in to comment.