Skip to content
Browse files

Added a failing spec for the quotes bug

  • Loading branch information...
1 parent 4f121f4 commit 3d53db1bd11e376b45737df779f70d67ef6125e7 Roger Campos committed Jan 7, 2012
Showing with 18 additions and 1 deletion.
  1. +17 −0 spec/integration/js_spec.rb
  2. +1 −1 test_app/app/models/user.rb
View
17 spec/integration/js_spec.rb
@@ -377,5 +377,22 @@
end
end
+
+ it "should display strings with quotes correctly in fields" do
+ @user.last_name = "A last name \"with double quotes\""
+ @user.save!
+
+ retry_on_timeout do
+ visit user_path(@user)
+
+ id = BestInPlace::Utils.build_best_in_place_id @user, :last_name
+ page.execute_script <<-JS
+ $("##{id}").click();
+ JS
+
+ text = page.find("##{id} input").value
+ text.should == "A last name \"with double quotes\""
+ end
+ end
end
View
2 test_app/app/models/user.rb
@@ -3,7 +3,7 @@ class User < ActiveRecord::Base
:length => { :minimum => 2, :maximum => 24, :message => "has invalid length"},
:presence => {:message => "can't be blank"}
validates :last_name,
- :length => { :minimum => 2, :maximum => 24, :message => "has invalid length"},
+ :length => { :minimum => 2, :maximum => 50, :message => "has invalid length"},
:presence => {:message => "can't be blank"}
validates :address,
:length => { :minimum => 5, :message => "too short length"},

0 comments on commit 3d53db1

Please sign in to comment.
Something went wrong with that request. Please try again.