Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing _testium_ cookies #5

Merged
merged 1 commit into from
Oct 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/processes/proxy/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var firstPage = true;
var newPageOptions = {};

function markNewPage(options, response, fromPort) {
var newPageOptions = normalizeOptions(options);
newPageOptions = normalizeOptions(options);
console.log('\n[System] Marking new page request with options: %j', newPageOptions);

openRequests.forEach(function(request) {
Expand Down
9 changes: 9 additions & 0 deletions test/testium-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ var gofer = new Gofer({
function fetch(uri, options) {
return Bluebird.resolve(gofer.fetch(uri, options));
}
function fetchResponse(uri, options) {
return Bluebird.resolve(gofer.fetch(uri, options).getResponse());
}

tap.test('Init against hello-world', function(t) {
process.chdir(__dirname + '/../examples/hello-world');
Expand All @@ -27,6 +30,12 @@ tap.test('Init against hello-world', function(t) {
})
.then(function(result) {
t.equal(result, 'Hello Quinn', 'New page url redirects to target');
return fetchResponse(testium.getNewPageUrl('/echo', { 'x': 'y' }));
})
.then(function(response) {
t.ok(response.headers['set-cookie'], 'Sets a cookie');
t.ok(('' + response.headers['set-cookie']).indexOf('_testium_=') !== -1,
'Sets a _testium_ cookie');
})
.then(function() {
t.end();
Expand Down