navigation.js
968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module.exports = function () {
var expect = require('expect.js');
this.World = require('../support/world.js').World;
this.Given('I go to "$path"', function (path, callback) {
this.spooky.thenOpen(this.testUrl + path);
callback();
});
this.Given('I go back', function (callback) {
this.spooky.back();
callback();
});
this.Given('I go forward', function (callback) {
this.spooky.forward();
callback();
});
this.When('I go back', function (callback) {
this.spooky.back();
callback();
});
this.When('I go forward', function (callback) {
this.spooky.forward();
callback();
});
this.Then('I should be on "$path"', function (path, callback) {
this.spooky.then([{
url: this.testUrl + path
}, function () {
this.test.assert(this.getCurrentUrl() === url);
}]);
callback();
});
};