summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
Diffstat (limited to 'features')
-rw-r--r--features/config.feature5
-rw-r--r--features/support/hooks.rb14
2 files changed, 14 insertions, 5 deletions
diff --git a/features/config.feature b/features/config.feature
index 6e6c429..066d4c4 100644
--- a/features/config.feature
+++ b/features/config.feature
@@ -29,10 +29,7 @@ Feature: Download Provider Configuration
Scenario: Missing provider config
When I send a GET request to "/provider.json"
Then the response status should be "404"
- And the response should be:
- """
- {"error": "not found"}
- """
+ And the response should have ".error" with the text "not_found"
Scenario: Fetch list of available configs
When I send a GET request to "/1/configs.json"
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