diff options
author | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-01-21 13:27:19 +0000 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@gentoo.org> | 2012-01-21 13:27:19 +0000 |
commit | f03cddeef178194f325eccc861b40127202e2e75 (patch) | |
tree | 25e866cff8dde16126f7558e3d90ed8e232c8c61 /dev-ruby/best_in_place/files | |
parent | Drop old. (diff) | |
download | gentoo-2-f03cddeef178194f325eccc861b40127202e2e75.tar.gz gentoo-2-f03cddeef178194f325eccc861b40127202e2e75.tar.bz2 gentoo-2-f03cddeef178194f325eccc861b40127202e2e75.zip |
Revision bump, replacing the patch to disable tests with one that fixes them, and another issue as well.
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64)
Diffstat (limited to 'dev-ruby/best_in_place/files')
-rw-r--r-- | dev-ruby/best_in_place/files/best_in_place-1.0.4-disable-some-tests.patch | 53 | ||||
-rw-r--r-- | dev-ruby/best_in_place/files/best_in_place-1.0.4-gentoo.patch | 77 |
2 files changed, 77 insertions, 53 deletions
diff --git a/dev-ruby/best_in_place/files/best_in_place-1.0.4-disable-some-tests.patch b/dev-ruby/best_in_place/files/best_in_place-1.0.4-disable-some-tests.patch deleted file mode 100644 index 8db8554f4617..000000000000 --- a/dev-ruby/best_in_place/files/best_in_place-1.0.4-disable-some-tests.patch +++ /dev/null @@ -1,53 +0,0 @@ -Index: best_in_place-1.0.4/spec/integration/js_spec.rb -=================================================================== ---- best_in_place-1.0.4.orig/spec/integration/js_spec.rb -+++ best_in_place-1.0.4/spec/integration/js_spec.rb -@@ -279,23 +279,6 @@ describe "JS behaviour", :js => true do - text.should == "Via Roma 99" - end - end -- -- it "should display the updated content after editing the field two consecutive times" do -- @user.save! -- retry_on_timeout do -- visit user_path(@user) -- -- bip_text @user, :address, "New address" -- -- id = BestInPlace::Utils.build_best_in_place_id @user, :address -- page.execute_script <<-JS -- $("##{id}").click(); -- JS -- -- text = page.find("##{id} input").value -- text.should == "New address" -- end -- end - end - - describe "display_with" do -@@ -347,24 +330,6 @@ describe "JS behaviour", :js => true do - end - end - -- it "should display the updated content after editing the field two consecutive times" do -- @user.save! -- -- retry_on_timeout do -- visit user_path(@user) -- -- bip_text @user, :money, "40" -- -- id = BestInPlace::Utils.build_best_in_place_id @user, :money -- page.execute_script <<-JS -- $("##{id}").click(); -- JS -- -- text = page.find("##{id} input").value -- text.should == "40" -- end -- end -- - it "should show the money in euros" do - @user.save! - visit double_init_user_path(@user) diff --git a/dev-ruby/best_in_place/files/best_in_place-1.0.4-gentoo.patch b/dev-ruby/best_in_place/files/best_in_place-1.0.4-gentoo.patch new file mode 100644 index 000000000000..d143d7eed1c9 --- /dev/null +++ b/dev-ruby/best_in_place/files/best_in_place-1.0.4-gentoo.patch @@ -0,0 +1,77 @@ +diff --git a/lib/best_in_place/helper.rb b/lib/best_in_place/helper.rb +index 7ab2561..7d40f58 100644 +--- a/lib/best_in_place/helper.rb ++++ b/lib/best_in_place/helper.rb +@@ -43,7 +43,7 @@ module BestInPlace + out << " data-type='#{opts[:type]}'" + out << " data-inner-class='#{opts[:inner_class]}'" if opts[:inner_class] + out << " data-html-attrs='#{opts[:html_attrs].to_json}'" unless opts[:html_attrs].blank? +- out << " data-original-content='#{object.send(field)}'" if opts[:display_as] || opts[:display_with] ++ out << " data-original-content='#{attribute_escape(object.send(field))}'" if opts[:display_as] || opts[:display_with] + if !opts[:sanitize].nil? && !opts[:sanitize] + out << " data-sanitize='false'>" + out << sanitize(value, :tags => %w(b i u s a strong em p h1 h2 h3 h4 h5 ul li ol hr pre span img br), :attributes => %w(id class href)) +@@ -80,6 +80,10 @@ module BestInPlace + object.send(field).to_s.presence || "" + end + end ++ ++ def attribute_escape(data) ++ data.to_s.gsub("&", "&").gsub("'", "'") unless data.nil? ++ end + end + end + +diff --git a/spec/integration/js_spec.rb b/spec/integration/js_spec.rb +index 38e09c8..e773108 100644 +--- a/spec/integration/js_spec.rb ++++ b/spec/integration/js_spec.rb +@@ -466,15 +466,32 @@ describe "JS behaviour", :js => true do + + bip_text @user, :address, "New address" + ++ sleep 1 ++ + id = BestInPlace::Utils.build_best_in_place_id @user, :address + page.execute_script <<-JS + $("##{id}").click(); + JS + ++ sleep 1 ++ + text = page.find("##{id} input").value + text.should == "New address" + end + end ++ ++ it "should quote properly the data-original-content attribute" do ++ @user.address = "A's & B's" ++ @user.save! ++ retry_on_timeout do ++ visit user_path(@user) ++ ++ id = BestInPlace::Utils.build_best_in_place_id @user, :address ++ ++ text = page.find("##{id}")["data-original-content"] ++ text.should == "A's & B's" ++ end ++ end + end + + describe "display_with" do +@@ -534,11 +551,15 @@ describe "JS behaviour", :js => true do + + bip_text @user, :money, "40" + ++ sleep 1 ++ + id = BestInPlace::Utils.build_best_in_place_id @user, :money + page.execute_script <<-JS + $("##{id}").click(); + JS + ++ sleep 1 ++ + text = page.find("##{id} input").value + text.should == "40" + end |