The difference between RSpec, Capybara and Cucumber
20-Jun-2019 1989
RSpecRSpec is a testing framework. It’s what allows you to write and run your tests.An analogous tool would be MiniTest. In my experience, most commercial Rails projects use RSpec and most open-source Ruby projects use MiniTest. At any Rails job you’re more likely to be using RSpec than MiniTest. (I’m not sure why this is the way it is.)CapybaraSome Rails tests operate at a “low level”, meaning no browser interaction is involved. Other “high level” tests do actually spin up a browser and click links, fill out form fields, etc.Low-level tests can be executed with just RSpec and nothing more. But for tests that use the browser, something more is needed.This is where Capybara comes into the picture. Capybara provides helper methods like fill_in to fill in a form field, click_on to click a button, etc.Please note that Capybara does NOT have to be used in conjunction with Cucumber. It’s completely possible to write integration tests in Rails with just RSpec and Capybara.
The difference between RSpec, Capybara and Cucumber #ruby #rubydeveloper #rubyonrails #difference #between #RSpec, #Capybara #Cucumber #rspec, https://rubyonrails.ba/link/the-difference-between-rspec-capybara-and-cucumber