From 303ec07901af3798efc873cbe050aa5cb4ba7655 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 8 Jul 2014 11:00:40 +0200 Subject: use cucumber; initial ConfigsController --- features/support/hooks.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 features/support/hooks.rb (limited to 'features/support/hooks.rb') diff --git a/features/support/hooks.rb b/features/support/hooks.rb new file mode 100644 index 0000000..360f231 --- /dev/null +++ b/features/support/hooks.rb @@ -0,0 +1,6 @@ +After('@tempfile') do + if @tempfile + @tempfile.close + @tempfile.unlink + end +end -- cgit v1.2.3 From bb10a669e1129c662ba01f223bd5a0ee7f2a0344 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 14 Jul 2014 18:00:14 +0200 Subject: fix controller refactor and features Also save debug log on failing features --- features/support/hooks.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'features/support/hooks.rb') 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 -- cgit v1.2.3