Commit 4474167

mo khan <mo@mokhan.ca>
2016-05-07 14:09:31
pretty print html on failure.
1 parent f692d7b
Changed files (2)
spec/features/gyms_spec.rb
@@ -38,7 +38,6 @@ feature "Gyms", type: :feature do
 
       it "returns gyms that match the search criteria", js: true do
         subject.visit_page
-        puts subject.pretty_print
         subject.search("sait")
 
         expect(subject).to be_on_page
spec/rails_helper.rb
@@ -65,4 +65,10 @@ RSpec.configure do |config|
   config.after(:each) do
     DatabaseCleaner.clean
   end
+
+  config.after(:each) do |example|
+    if example.metadata[:type] == :feature && example.exception.present?
+      puts subject.pretty_print
+    end
+  end
 end