test that input value is not affected by auto suggest

This commit is contained in:
Taylor Griffin
2014-08-24 10:53:24 +10:00
parent ca41f86d93
commit d038ac6d8a
2 changed files with 10 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ jQuery ->
el.autocomplete
minLength: 1,
source: el.attr( 'data-source-url' ),
autoFocus: true,
focus: ( event, ui ) ->
el.val( ui.item.name )
id.val( ui.item.id )

View File

@@ -24,4 +24,13 @@ shared_examples "crop suggest" do |resource|
expect(page).to have_selector("input##{resource}_crop_id[value='#{pear.id}']", :visible => false)
end
scenario "Typing and pausing does not affect input" do
within "form#new_#{resource}" do
fill_autocomplete "crop", :with => "p"
end
expect(page).to have_content("pear")
expect(find_field("crop").value).to eq("p")
end
end