Tests for issue #1702

move_new_block
Ulrich Gabor 2016-01-05 15:10:49 +01:00
parent 5684caeee6
commit 1ca5be7b19
4 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,23 @@
# encoding: iso-8859-1
Feature: encoding option
Scenario: No encoding set
Given a fixture app "clean-app"
Given the Server is running at "clean-app"
When I go to "/index.html"
Then the "Content-Type" header should contain "text/html"
Then the "Content-Type" header should contain "charset=utf-8"
Scenario: Custom encoding set
Given a fixture app "i-8859-1-app"
And a file named "config.rb" with:
"""
set :encoding, "ISO-8859-1"
"""
Given the Server is running at "i-8859-1-app"
When I go to "/index.html"
Then the "Content-Type" header should contain "text/html"
Then the "Content-Type" header should contain "charset=iso-8859-1"
Then I should see "äöü"

View File

@ -0,0 +1 @@
set :encoding, "ISO-8859-1"

View File

@ -0,0 +1 @@
<EFBFBD><EFBFBD><EFBFBD>

View File

@ -75,6 +75,10 @@ Then /^the content type should be "([^\"]*)"$/ do |expected|
expect(page.response_headers['Content-Type']).to start_with expected
end
Then /^the "([^\"]*)" header should contain "([^\"]*)"$/ do |header, expected|
expect(page.response_headers[header]).to include expected
end
Then /^I should see "([^\"]*)"$/ do |expected|
expect(page.body).to include expected
end