Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bip_text Test Helper datapicker MiniTest failure #615

Open
sean-whiley opened this issue May 24, 2019 · 0 comments
Open

bip_text Test Helper datapicker MiniTest failure #615

sean-whiley opened this issue May 24, 2019 · 0 comments

Comments

@sean-whiley
Copy link

When using the bip_text Test Helper with a Capybara, MiniTest test, the test would fail because the date would fail its assertion of a specific entered date.

This was caused by the datepicker reseting itself when the test moved onto the next text entry point.

Adding a new method solved this problem:

def bip_date(model, attr, new_value)
  id = BestInPlace::Utils.build_best_in_place_id model, attr
  find("##{id}").click
  execute_script <<-JS
    $("##{id} input[name='#{attr}']").
      datepicker("setDate", '#{escape_javascript new_value.to_s}').
      datepicker("hide");
  JS
  wait_for_ajax
end

I tried to create a fork and make the changes but could not get the appraisal tests to run.

So if anyone is looking for a fix this might help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant