diff options
author | Azul <azul@leap.se> | 2014-07-14 18:00:14 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2014-07-14 18:00:14 +0200 |
commit | bb10a669e1129c662ba01f223bd5a0ee7f2a0344 (patch) | |
tree | 264f44be78d397d81b701940fa0ac4d1eaf9a682 /features/support/hooks.rb | |
parent | 2f1ceb63bfef2fa7d92fcbad73a5ead5bd17b23e (diff) |
fix controller refactor and features
Also save debug log on failing features
Diffstat (limited to 'features/support/hooks.rb')
-rw-r--r-- | features/support/hooks.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/features/support/hooks.rb b/features/support/hooks.rb index 360f231..19928d8 100644 --- a/features/support/hooks.rb +++ b/features/support/hooks.rb @@ -1,6 +1,18 @@ -After('@tempfile') do +After '@tempfile' do if @tempfile @tempfile.close @tempfile.unlink end end + +After do |scenario| + if scenario.failed? + logfile_path = Rails.root + 'tmp' + logfile_path += "#{scenario.title.gsub(/\s/, '_')}.log" + File.open(logfile_path, 'w') do |test_log| + test_log.puts scenario.title + test_log.puts "=========================" + test_log.puts `tail log/test.log -n 200` + end + end +end |