Skip to content

Commit

Permalink
Add hbs, server route and tests for friends page.
Browse files Browse the repository at this point in the history
Related #65.
  • Loading branch information
RhodesPeter committed Mar 15, 2017
1 parent 40294b5 commit fb1a202
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
13 changes: 13 additions & 0 deletions public/views/friends.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<div class="introduction">
<img class="sleeping-lion" src="assets/lion-sleeping.svg" alt="Sleeping Lion"></img>
<div class="introduction__text">
<p>What is your name?<p>
<input class="text-input name" type="text" autofocus="">
</div>
<div class="introduction__text">
<p>How old are you?<p>
<input class="text-input age" type="text" autofocus="">
</div>
</div>

{{> buttons }}
13 changes: 12 additions & 1 deletion src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,22 @@ module.exports = [
handler: (request, reply) => {
var data = {
prev: '/personality',
next: '/finished'
next: '/friends'
};
reply.view('hobbies', data);
}
},
{
method: 'GET',
path: '/friends',
handler: (request, reply) => {
var data = {
prev: '/hobbies',
next: '/finished'
};
reply.view('friends', data);
}
},
{
method: 'GET',
path: '/finished',
Expand Down
11 changes: 11 additions & 0 deletions tests/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,17 @@ test('Check /hobbies', t => {
});
});

test('Check /friends', t => {
const options = {
method: 'GET',
url: '/friends'
};
server.inject(options, response => {
t.equal(response.statusCode, 200, 'You received a 200 status code');
t.end();
});
});

test('Check /finished', t => {
const options = {
method: 'GET',
Expand Down

0 comments on commit fb1a202

Please sign in to comment.