-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require '../support/factory_girl_helper' | ||
include FactoryGirlHelper | ||
|
||
# generate template | ||
puts <<EOS | ||
class Handler | ||
def on_read_response_hdr | ||
hout = ATS::Headers_out.new | ||
f = ATS::Filter.new | ||
f.body = "#{get(:headers_out_get).key}: " + hout["#{get(:headers_out_get).key}"] | ||
end | ||
end | ||
es = ATS::EventSystem.new | ||
es.register Handler | ||
EOS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class HeadersOutGet | ||
attr_accessor :path, :key | ||
end | ||
|
||
FactoryGirl.define do | ||
factory :headers_out_get do | ||
path '/ats_headers_out_get' | ||
key 'Server' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
require './spec_helper' | ||
|
||
describe 'ATS class', :js => false do | ||
let (:getter) { get(:headers_out_get) } | ||
|
||
describe 'get' do | ||
it 'gets specified response header field value' do | ||
visit getter.path | ||
expect(page.body).to match(/^#{getter.key}: .+$/) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters