Sha256: 918c640dc9248b083780d7205117deb285b96ea57c1dd906c90a8b21145e9284

Contents?: true

Size: 771 Bytes

Versions: 1

Compression:

Stored size: 771 Bytes

Contents

$('form').live 'submit', ->
  scenario = ["  scenario 'GENERATED' do"]
  scenario.push "    visit '#{window.location.pathname}'"
  $(this).find('input[type=text],input[type=email],input[type=url],input[type=number],input[type=search],textarea').each ->
    scenario.push "    fill_in '#{$(this).attr('id')}', :with => '#{$(this).val()}'"
  $(this).find('select').each ->
    scenario.push "    select '#{$(this).children(':selected').text()}', :from => '#{$(this).attr('id')}'"
  scenario.push "    click_button '#{$(this).find('input[type=submit]').val()}'"
  $(this).append '<textarea id="<%= HocusPocus::Recorder::SPEC %>" name="<%= HocusPocus::Recorder::SPEC %>" style="height: 0px; width: 0px;" />'
  $('#<%= HocusPocus::Recorder::SPEC %>').val(scenario.join('\n'))

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hocus_pocus-0.2.0 engines/recorder/lib/assets/javascripts/recorder.js.coffee.erb