All posts tagged with 'rspec'
Waiting for it with Capybara’s synchronize method
Feature specs are notorious for their potential to flake. It’s possible for the results of feature specs to be inconsistent because they have to deal with asynchronous state. In a typical test environment, there’s a single Ruby process at play, so test code will be executed in order as written – we can reasonably expect one line to complete before the next is executed. But when it comes to feature specs… Continue reading
View specs: rendering templates that are nested within a view component
FreeAgent makes use of the RSpec and ViewComponent frameworks for unit testing and reusable front-end components respectively. Since FreeAgent is a Ruby on Rails application, we’ll often want to write unit tests for our Rails view templates, using RSpec, i.e., a view spec. When rendering our reusable view components in our view templates, especially complex ones, testing can get a bit confusing, especially if the template is dependent on being… Continue reading