Skip to content

Commit

Permalink
Switch Capybara check in after hook to check for class inclusion.
Browse files Browse the repository at this point in the history
Using  initializes a new Capybara::Session, which, aside from being expensive,
can cause issues on non-Capybara tests.
  • Loading branch information
neodude committed Dec 5, 2014
1 parent cd17f66 commit 27cc1a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara-screenshot/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class << self
attr_accessor :add_link_to_screenshot_for_failed_examples

def after_failed_example(example)
if Capybara.page.respond_to?(:save_page) # Capybara DSL method has been included for a feature we can snapshot
if example.example_group.include?(Capybara::DSL) # Capybara DSL method has been included for a feature we can snapshot
Capybara.using_session(Capybara::Screenshot.final_session_name) do
if Capybara.page.current_url != '' && Capybara::Screenshot.autosave_on_failure && example.exception
filename_prefix = Capybara::Screenshot.filename_prefix_for(:rspec, example)
Expand Down

0 comments on commit 27cc1a5

Please sign in to comment.