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

Fixed Zombie update errors #111

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
67 changes: 31 additions & 36 deletions ch05/qa/tests-crosspage.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
var Browser = require('zombie'),
assert = require('chai').assert;

var Browser = require('zombie'), assert = require('chai').assert;
var browser;

suite('Cross-Page Tests', function(){
setup(function(){
browser = new Browser();
});
test('requesting a group rate quote from the hood river tour page' + 'should populate the referrer field', function(done){
var referrer = 'http://localhost:3000/tours/hood-river';
browser.visit(referrer, function(){
browser.link('.requestGroupRate', function(){
assert(browser.referrer === referrer);
done();
});
});
done();
});
test('requesting a group rate from the oregon coast tour page should ' + 'populate the referrer field', function(done){
var referrer = 'http://localhost:3000/tours/oregon-coast';
browser.visit(referrer, function(){
browser.link('.requestGroupRate', function(){
console.log(referrer);
done();
});
});
done();
});

setup(function(){
browser = new Browser();
});

test('requesting a group rate quote from the hood river tour page should ' +
'populate the hidden referrer field correctly', function(done){
var referrer = 'http://localhost:3000/tours/hood-river';
browser.visit(referrer, function(){
browser.clickLink('.requestGroupRate', function(){
assert(browser.field('referrer').value === referrer);
done();
});
});
});

test('requesting a group rate from the oregon coast tour page should ' +
'populate the hidden referrer field correctly', function(done){
var referrer = 'http://localhost:3000/tours/oregon-coast';
browser.visit(referrer, function(){
browser.clickLink('.requestGroupRate', function(){
assert(browser.field('referrer').value === referrer);
done();
});
});
});
test('visiting the "request group rate" page directly should result ' + 'in an empty referrer field', function(done){
browser.visit('http://localhost:3000/tours/request-group-rate', function(){
assert(browser.referrer == null)
done();
});
done();
});

test('visiting the "request group rate" page dirctly should result ' +
'in an empty value for the referrer field', function(done){
browser.visit('http://localhost:3000/tours/request-group-rate', function(){
assert(browser.field('referrer').value === '');
done();
});
});

});