Totally confused in testing rails .. what tools for what tasks?

I learn Rails after a long time manually testing my own .NET code,

I love what ive saw, but I'm SO confused about how it all fits together!

So my questions

1 - Where would I use:

Rspec

Cucumbers

Test block

Shoulda

Selenium (actually not a ruby ​​thing, but more a thing on the network that I heard)

I kind of tested my code with very simple RSpec on my models and using factory girl ..

2 - Do I need all these tools?

For example, I can choose a cucumber and a factory girl and never recognize rspec or a cucumber pretty dsl wrapper for rspec and testing unit ...

3 - Is it possible to use any of them / have a port on .NET?

Thanks!

Daniel

+4
source share
2 answers

My current stack of testing tools:

  • Steak instead of cucumber.
  • Capybara with Akephalos driver, instead of Selenium.
  • RSpec
  • Machinist2 instead of a factory girl.

https://github.com/cavalle/steak

https://github.com/jnicklas/capybara

http://rspec.info/

https://github.com/notahat/machinist

I learned a lot about testing with the book: Rspec Book, by pragmatic programmers.

http://pragprog.com/

You have more details in this other question:

Rails: a good example of using rspec2? (Also: Cucumbers, Pickle, Capybara)

+3
source

For 1)

I use Rspec for modulation and functional testing.

I use Cucumber to test integration. Cucumbers use Capybara or Selenium. I like Cucumber because it allows me to write tests with clients. They feel involved and therefore sometimes provide more detailed information about their expectations.

Selenium can be used as a standalone application to test your web application directly in your browser.

There are many other tools, this is really a matter of choice. As you said, lights are no longer used, Factory Girl is one of the best ways to create test data sets.

For 2)

Of course, you do not need all these tools. You can even write your tests using native Rails helpers.

But they provide convenient helpers from which you can take advantage. So get the one you prefer. Some, such as Cucumber, have extensions (such as Pickle) to provide even more helpers.

For 3)

The strength of Rspec, Cucumber, Selenium (the ones I know), they can be used to test any application.

I am interested in listening to another point of view regarding Ajax testing.

+2
source

Source: https://habr.com/ru/post/1334856/


All Articles