0

In testing my rails app (using RSpec and Capybara) I am having troubles testing AngularJS functions (from the Users point of view). Can I not test with only RSpec and Capybara or do I also need something like protractor?

any help would be great! thank you!

2 Answers 2

1

You could test with Capybara, so long as you use a driver that supports javascript, such as Selenium or Poltergeist - see https://github.com/jnicklas/capybara#drivers

However, although I'm not an AngularJS user, I do know that it's designed to be testable, and I imagine you'd be much better off using a tool specifically for javascript testing, rather than capybara.

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

Comments

0

As long as angular provides it's own methods and functionalities you should separate the testing suite into two. The first one, rspec, capybara and rails will be testing just the non-angular pages.

Second one, using a tool like jasmine should be testing the angular behaviour. Both combined provides good coverage of the application.

https://docs.angularjs.org/guide/unit-testing

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.