Search code examples
ruby-on-railsrspeccapybara

Automatic js: true on rspec system specs?


all my system tests/specs have js: true, is there a way to automatically add that tag/metadata to my system tests/specs?

require "rails_helper"

RSpec.describe "redirect_to", js: true do
  ...
end

Edit: Hmmm, I was relying on js: true for database_cleaner but replaced it with type: :system and now I don't need this hack


Solution

  • config.before(:each, type: :system) { |example| example.metadata[:js] = true }