Sha256: b4d5bcb7ad985e136044ade7c6b5084c3496b522986036c600a05be005a15a10
Contents?: true
Size: 1.21 KB
Versions: 2
Compression:
Stored size: 1.21 KB
Contents
module BestInPlaceMongoid module TestHelpers def bip_area(model, attr, new_value) id = BestInPlaceMongoid::Utils.build_best_in_place_id model, attr page.execute_script <<-JS $("##{id}").click(); $("##{id} form textarea").val('#{new_value}'); $("##{id} form textarea").blur(); JS end def bip_text(model, attr, new_value) id = BestInPlaceMongoid::Utils.build_best_in_place_id model, attr page.execute_script <<-JS $("##{id}").click(); $("##{id} input[name='#{attr}']").val('#{new_value}'); $("##{id} form").submit(); JS end def bip_bool(model, attr) id = BestInPlaceMongoid::Utils.build_best_in_place_id model, attr page.execute_script("$('##{id}').click();") end def bip_select(model, attr, name) id = BestInPlaceMongoid::Utils.build_best_in_place_id model, attr page.execute_script <<-JS (function() { $("##{id}").click(); var opt_value = $("##{id} select option:contains('#{name}')").attr('value'); $("##{id} select option[value='" + opt_value + "']").attr('selected', true); $("##{id} select").change(); })(); JS end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
best_in_place_mongoid-1.0.3 | lib/best_in_place_mongoid/test_helpers.rb |
best_in_place_mongoid-1.0.2 | lib/best_in_place_mongoid/test_helpers.rb |