Skip to content

Commit

Permalink
Add Capybara::DSL to visual_regression tests
Browse files Browse the repository at this point in the history
It doesn't strike me that they'll ever be a scenario where we want
visual regression tests without capybara. Therefore I've added the
visual_regression tag as one to also use the Capybara::DSL.

While doing this I took the liberty to update the visual_regression tag
usage to be the short form.
  • Loading branch information
kevindew committed Dec 10, 2024
1 parent 5898136 commit 1cdab18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Selenium::WebDriver::Options.chrome(loggingPrefs: { browser: "ALL" })

RSpec.configure do |config|
config.include Capybara::DSL, capybara: true
config.include Capybara::DSL, capybara: true, visual_regression: true
config.include Helpers::Components, type: :view
config.include ActiveSupport::Testing::TimeHelpers
end
2 changes: 1 addition & 1 deletion spec/visual_regression_tests/all_components_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require "percy/capybara"
require "uri"

describe "visual regression test runner Percy", visual_regression: true do
describe "visual regression test runner Percy", :visual_regression do
it "takes a screenshot of each component" do
# Freeze time for consistency
travel_to Time.zone.local(2020, 12, 1, 6, 0, 0)
Expand Down

0 comments on commit 1cdab18

Please sign in to comment.