-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This currently fails. The change in #259 will make it pass. Currently the image comes out at the wrong path (/hello-worldimage.jpg) ava doesnt have test.failing() yet, and our eslint config prevents the usage of test.todo() so this will most defininitely blow up travis.
- Loading branch information
Showing
6 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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,17 @@ | ||
import React from 'react' | ||
|
||
export default function html (props) { | ||
return ( | ||
<html> | ||
<head> | ||
</head> | ||
<body> | ||
<div id="react-mount" dangerouslySetInnerHTML={{ __html: props.body }} /> | ||
</body> | ||
</html> | ||
) | ||
} | ||
|
||
html.propTypes = { | ||
body: React.PropTypes.string, | ||
} |
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,9 @@ | ||
import React from 'react' | ||
|
||
export default function template (props) { | ||
return <div>{props.children}</div> | ||
} | ||
|
||
template.propTypes = { | ||
children: React.PropTypes.any, | ||
} |
Binary file added
BIN
+285 Bytes
test/fixtures/path-not-ending-in-slash/pages/hello-world-2016/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions
7
test/fixtures/path-not-ending-in-slash/pages/hello-world-2016/index.md
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,7 @@ | ||
--- | ||
title: Hello World | ||
date: "2015-05-01T22:12:03.284Z" | ||
path: "/hello-world" | ||
--- | ||
|
||
 |
26 changes: 26 additions & 0 deletions
26
test/integration/user-rewrites-path-not-ending-in-slash.js
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,26 @@ | ||
import test from 'ava' | ||
import path from 'path' | ||
import Promise from 'bluebird' | ||
import { build } from '../support' | ||
import fse from 'fs-extra' | ||
const fs = Promise.promisifyAll(fse) | ||
|
||
const fixturePath = path.resolve('..', 'fixtures', 'path-not-ending-in-slash') | ||
|
||
test.before('build the site', async () => { | ||
await build(fixturePath) | ||
}) | ||
|
||
test('the index page has been moved to the hardcoded path', async t => { | ||
const indexPath = path.resolve(fixturePath, 'public', 'hello-world', 'index.html') | ||
const file = await fs.statAsync(indexPath) | ||
|
||
t.truthy(file) | ||
}) | ||
|
||
test("the image has been moved to match the moved page's path", async t => { | ||
const imagePath = path.resolve(fixturePath, 'public', 'hello-world', 'image.jpg') | ||
const file = await fs.statAsync(imagePath) | ||
|
||
t.truthy(file) | ||
}) |