0

What is the best way create tests that include:

  • set checkbox
  • bush buttom
  • etc.

for Ruby on Rails test environment?

1 Answer 1

1

Use ActionDispatch::IntegrationTest to do this.

See the guides for more information: http://guides.rubyonrails.org/testing.html#integration-testing

If you want a better html control you can use capybara for this. (see the repo's README)

In your case the test would look something like this (with capybara):

class UiTest < ActionDispatch::IntegrationTest
  test "select check box and push button" do 
    visit "/my-route"
    check "A Checkbox" # => you can use the label or the id here
    click_on "A button" # => here too.
  end
end

Make sure that you have it setup right! See: https://github.com/jnicklas/capybara#using-capybara-with-testunit

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.