Commit Graph

109 Commits

Author SHA1 Message Date
Hannah Wolfe
e86bb50e7a Merge pull request #2450 from jaswilli/issue-2273
Add functional tests for admin navigation bar and menus
2014-04-05 18:57:31 +01:00
Hannah Wolfe
c38c778dbc Merge pull request #2500 from ErisDS/issue-2442
[WIP] Server start refactor, route tests use ghost app
2014-04-04 13:21:28 +01:00
Hannah Wolfe
e6abe9bab7 Server start refactor, route tests use ghost app
closes #2442, issue #2182

- Server start refactored - messaging is just messaging, deferred resolves the httpserver so that the connection can be closed
- Updated travis config to set node env
- Updated example config to be less travis-specific
- Route tests updated to use this new functionality
- Grunt test-routes simplified
2014-04-04 12:45:18 +01:00
Fabian Becker
4e664f0e1c Fixes tag cache test issues introduced in c6c4d5a8 2014-03-27 21:23:23 +01:00
Hannah Wolfe
13b65cecb9 Redirect feed -> rss
closes #2261

- reserved 'feed' in the list of reserved keywords for slugs
- added a 301 redirect from /feed/ to /rss/
- added a route test, and realised that standard express redirects don't get the right headers
- fixed the headers across all 301 redirects & added tests for the admin redirects
- removed the redirect from /ghost/login/ to /ghost/signin/ as this happens automatically if you're logged out, and isn't very useful if you're logged in as it just redirects again to /ghost/
2014-03-24 09:46:39 +00:00
Hannah Wolfe
d8f724d94d Removing typography extension
issue #2312

- The typography extension is still interfering in HTML blocks, reference style links and other bits and pieces it probably shouldn't be :(
- We'll add it back when it's ready.
2014-03-20 13:22:28 +00:00
Jason Williams
b460697a18 Add functional tests for admin navigation bar and menus
issue #2273
- Check that menu nav items exist
- Check that menu nav items are labeled correctly
- Check that menu nav items have correct URLs
2014-03-19 21:33:50 +00:00
Hannah Wolfe
5bed81563e Add shim for codemirror on touchscreens
fixes #2385

- stolen the CM shim from js-bin
- if we're on a touchscreen device, don't use CM
- if we're on a touchscreen device, show a coming soon message for uploads
2014-03-19 09:26:45 +00:00
mattse
9ae0ddf54c Fixes race conditions in functional test introduced in PR#2395
fixes PR#2395
- in editor_test.js line 272, I wait until the post settings menu appears, and THEN also wait until the delete post button appears, rather than just waiting for the first condition, this can result in a race condition which has been seen.
- in editor_test.js line 229, I click on the tag, then wait until it disappears, rather than asserting the tag doesn't exist immediately.  This could potentially result in a race condition, but I have not seen it yet.
- in editr_test.js line 315, I click on the delete post button, and now wait for the modal container to appear before clicking the accept button.  This could result in a race condition, but I have not seen it yet.
2014-03-17 03:06:22 -04:00
Hannah Wolfe
caa729e86a Merge pull request #2395 from mattse/mattse#2273
Added functional tests for editor: tag editor, image uploads, post settings
2014-03-14 11:48:37 +00:00
Hannah Wolfe
7f1721d8f0 Merge pull request #2392 from mattse/issue#2273
Added functional test for uploading image/cover in settings
2014-03-14 11:47:51 +00:00
mattse
1d5a8ce718 Added functional tests for editor: tag editor, image uploads, post settings
references #2273
- test tag creation and tag deletion
- tests image uploader appears after typing `![]()` in editor
- tests image URL matches url inside `![](url)`
- tests all input elements of post settings menu
2014-03-14 03:11:26 -04:00
Hannah Wolfe
60e316581a Merge pull request #2370 from halfdan/2062-robots
Serve default robots.txt
2014-03-13 21:30:04 +00:00
Fabian Becker
c3417fe090 Serve default robots.txt
closes #2062
- Server robots.txt from theme if available
- Serve default robots.txt from /core/shared/ otherwise
- Added tests for default robots.txt
2014-03-13 21:31:41 +01:00
Johan Stenehall
4556e1df0a Rss support for tags
closes #2260
- added routes for /tag/:slug/rss and /tag/:slug/rss/:page
- added support for tag in the rss controller
- added route tests for each extra case
- fixing a tiny typo in some test descriptions
2014-03-13 00:12:41 +01:00
mattse
36d38e5c81 Added functional test for uploading image/cover in settings
references #2273
- added a test that clicks on both upload (image/cover) buttons and tests the same testing function on them since both modals are exactly the same
- the testing function checks for the '.js-drop-zone.image-uploader' selector, then clicks accept, and tests that a blank success notification appears
- shifted the test email test validation upwards so the ordering of tests matches the ordering of the UI elements
2014-03-12 17:41:59 -04:00
Dan Schnau
b13db3a9d2 Do not cache 404 pages
closes #2334

- remove call to set cache-control in 404 response header
- update unit tests to expect this

Fix up unit tests
2014-03-06 20:06:07 -05:00
Mark Stacey
65b0968f40 Change validation for posts 'page' attribute.
issue #2305
- changed validation for 'page' to expect '0' or '1', rather than 'true' or
  'false'
- Added a 'can change a post to static page' test
- Added a 'can change a static page to a post' test
2014-03-04 17:59:00 -03:30
Jonathan Johnson
e4bb6d08cc Update validator to 3.4.0
Closes #1379

- Convert to new api usage for both server-side and client-side
- Provide way require a negative response for boolean methods in
  default-settings.json
- Add field validation functional tests
  - Settings (General)
    - Title length validation
    - Description length validation
    - postsPerPage, numeric, min, max
  - Settings (User)
    - Bio Length validation
    - Location length validation
    - Url validation
  - Login
    - Email validation
  - Editor
    - Title required validation
2014-03-04 13:54:24 -07:00
Fabian Becker
cd74b0e232 Switch to bower for client assets.
fixes #2272
- Remove libraries from shared/vendor
- Remove libraries from client/assets/vendor
- Add bower to package.json and postinstall
- Add bower.json with dependencies
- Add scripts from bower_components to concat/uglify
- Fix tests
- Serve jquery from /ghost/built/theme/
2014-03-04 20:09:26 +00:00
Gabor Javorszky
667888aeb3 Implements Initial lifecycle and App UI start
Closes #2083

* Added hbs template for apps listing
* Added settings to read the activeApps
* Added viewcontrol to activate / deactivate apps
* Added API handler to store activeApps (by `name` in the `package.json` file)
* On button click it turns the button into "Working" and changes class to `button` (grey one)
* On success, rerenders the pane, adds success notification about apps being saved
* On error, rerenders the pane, adds error notification with error message

Missing:
* tests: couldn't figure out how to add mock apps with mock package.json data
* actually registering, etc, re #2140
* icon from the sidebar
2014-02-28 14:06:36 +00:00
Hannah Wolfe
c64148f361 Merge pull request #2256 from caerphoto/1795-typography
Add support for typographically-correct punctuation
2014-02-28 10:49:06 +00:00
Andy
b49f10c33d Add support for typographically-correct punctuation
Closes #1795
- Added typography.js Showdown extension
- Updated RSS test to support new typographic quotes
2014-02-28 09:44:08 +00:00
Hannah Wolfe
36102d4f9f Merge pull request #2246 from knunery/issue#1432
Fixes client side bio character counter.
2014-02-27 16:02:13 +00:00
Hannah Wolfe
aa15b464c8 /ghost/reset/* should not redirect to signin
fixes #2257
2014-02-25 10:44:16 +00:00
Hannah Wolfe
ccaceb7310 Renamed client-side admin url helper
fixes #2254

- includes test
2014-02-25 06:44:06 +00:00
Kyle Nunery
6e1d5e8e0d Fixes client side bio character counter.
closes #1432
2014-02-23 16:16:45 -06:00
Sebastian Gierlinger
ea6c601b01 Improvements for models
#closes #1655
- removed models as parameter for bookshelf-session
- changed to read permittedAttributes from schema.js
- changed updateTags to be executed at saved event
- added validate to execute after saving event
- added test for published_at = null (see #2015)
- fixed typo in general.hbs
2014-02-19 14:57:26 +01:00
Hannah Wolfe
e81924282c Merge pull request #2190 from sebgie/issue#2171
Make session expiry less arsey
2014-02-18 22:05:44 +00:00
Harry Wolff
9ab4b7d4d5 Adds tag pages
fixes #2111

- modified Post model to support a tag query
  param that will filter the desired post collection
  to only include posts that contain the requested tag

- in the updated Post model it includes the Tag model
  under a nested object called 'aspects'

- added tests for updated Post model, updating
  test utils to add more posts_tags relations

- adds two new routes to frontend,
  one for initial tag page,
  another to page that tag page

- for tag pages the array of posts
  is exposed to the view similarly
  to the homepeage

- on the tag view page the information
  for the tag is also accessible
  for further theme usage

- the tag view page supports a hierarchy of
  views, it'll first attempt to use a tag.hbs
  file if it exists, otherwise fall back
  to the default index.hbs file

- modified pageUrl and pagination helper
  to have it be compatible with tag paging

- added unit tests for frontend controller

- added unit tests for handlebar helper modifications

- add functional tests for new tag routes
2014-02-18 15:10:02 -05:00
Sebastian Gierlinger
d3c641ea31 Make session expiry less arsey
closes #2171
- added authentication middleware
- removed authentication from routes
- moved authentication before CSRF validation
- moved caching rules before authentication
- changed/added test
2014-02-14 11:00:11 +01:00
Hannah Wolfe
0dc0a9bb7c Merge pull request #2126 from aiampogi/issue-2114-rssFeeds
Removed author tag inside channel tag in RSS
2014-02-07 11:52:41 +00:00
John-David Dalton
6eab7b3f92 Replace underscore with lodash. 2014-02-06 14:08:34 +00:00
balduv
eadbf7dffb Removed author tag inside channel tag in RSS
closes #2114
- instead of putting author in feedOptions of node-rss, it was moved to itemOptions
- supplying author: user ? user.name : null in itemOptions will still result to creating a dc:creator tag inside item tags so the info needed to have the author is still there like before
- node-rss should however still fix this quirk to not have that nasty author tag in channel tag when you supply author in feedOptions
2014-02-05 13:59:07 +08:00
Hannah Wolfe
f185a5d616 General cleanup
- Cleanup some todos, comments, and unused variables
2014-01-19 21:08:39 +00:00
Hannah Wolfe
9f0dea0559 Minor fixes to asset helper and tests
no issue

- asset helper ignores it if theme devs specify the asset dir
- asset helper strips leading slashes
- static asset tests were wrong
2014-01-12 21:48:34 +00:00
Hannah Wolfe
3dea6431df Ensure cookies are only ever set for admin
fixes #1901

- Adds a trailing slash to the cookie path
- Resolves random log-outs
- Adds a test which proves the case
2014-01-12 17:08:48 +00:00
Hannah Wolfe
af6137248d New URL helper - URL consistency fixes
fixes #1765
fixes #1811
issue #1833

New UrlFor functions

- moved body of url helper to config.path.urlFor, which can generate a URL for various scenarios
- urlFor can take a string (name) or object (relativeUrl: '/') as the first
  argument - this is the first step towards issue #1833
- also added config.path.urlForPost which is async and handles getting
  permalink setting
- frontend controller, ghost_head helper, cache invalidation all now use
  urlFor or urlForPost all urls should be correct and consistent

URL Consistency Improvements

- refactored invalidateCache into cacheInvalidationHeader which returns a
  promise so that url can be generated properly by urlForPost
- moved isPost from models to schema, and refactored schema to have a tables object
- deleted posts now return the whole object, not just id and slug,
  ensuring cache invalidation header can be set on delete
- frontend controller rss and archive page redirects work properly with subdirectory
- removes {{url}} helper from admin and client, and replaced with adminUrl
  helper which also uses urlFor
- in res.locals ghostRoot becomes relativeUrl, and path is removed
2014-01-06 15:15:48 +00:00
Hannah Wolfe
05dd48feb7 Improving regexes in functional tests
- being more explicit about what resources we expect to load after saving
  a post
- should prevent #1839 from failing tests
2014-01-05 21:10:48 +00:00
Harry Wolff
ab80a132f3 Adds ability to quickly get to post’s edit page
fixes #1810

- updates frontend.single route to accept ‘edit’
as the last param

- updates controller.frontend to handle redirection
only when we would otherwise have rendered the page

- added unit tests for this behavior
2014-01-03 18:16:00 -05:00
Hannah Wolfe
a50f5e1b9d Merge pull request #1815 from ErisDS/more-tests
Error handling simplification & test improvements
2014-01-02 18:13:27 -08:00
Harry Wolff
20055157ef Fixes admin session cookie test
- Currently the test is taking the response date
which is in UTC and passes it through moment()
which by default parses input as local time.  We
then add 12 hours to this now local time
and when compared against the response set-cookie
header the time spread is wrong.

- To fix we’re parsing the response date with
moment.utc which parses the date in UTC.
2014-01-02 21:06:23 -05:00
Hannah Wolfe
495b7b7f05 Error handling simplification & test improvements
fixes #1266

- simplifies the check for if a theme has an error template
- adds more / better tests for error handling
2014-01-02 21:03:37 +00:00
Hannah Wolfe
1925fa0196 Cache control headers & query string asset management
closes #1470
issue #1405

- added cache control middleware
- added defaults for all routes, assets, etc
- updated asset helper to add a query string with a timestamp hash to all assets
- added unit tests for asset and ghostScriptTags helpers
- added cache-control checks to route tests
2014-01-02 12:14:33 +00:00
Hannah Wolfe
a697a631c2 Route tests
issue #1773

- Adds functional tests for frontend routing
- Tests the request-response contract
- Requires db access at the moment
- Tests #1790
2014-01-01 16:18:03 +00:00
Hannah Wolfe
a2a606a920 Functional test debugging & improvements
issue #1702
2014-01-01 14:52:49 +00:00
Hannah Wolfe
bfe80da54a Enforce 2-digit dates in permalinks
fixes #1800

- changed permalink regex to require 4/2/2/slug
- changed url helper to enforce the same
- changed permalink toggle to set a specific state, this means the
  functional tests are independent again
- chnaged permalink toggle to wait for the settings page to load
- change as many frontend tests to not login as possible
2014-01-01 11:39:19 +00:00
Harry Wolff
91ca4a43e5 Fix routing of posts and static pages
closes #1757 and #1773

- switches routes.frontend for posts and pages
to use a regex with two capturing groups.  This removes
the need to dynamically remove an express route at a
later point, leaving the decision making to frontend
controller.

- added unit tests for all routing conditions that 
can arise for posts and pages.

- updated functional tests to also test for same thing
in unit tests

- removes old code from server/api/index that used
to fix this issue, but is no longer needed

- removed some un-needed require statements in routes/admin
2013-12-30 02:04:46 -05:00
Mark Berger
0b8fbbb68a RSS uses correct links when dated permalinks are enabled
closes #1777
- Uses coreHelpers.url to resolve post url instead of assuming it is siteUrl + post.slug
- Functional feed tests now check for content instead of just rss tags
2013-12-29 17:13:38 -05:00
Hannah Wolfe
a8e987ec6c Shared folder asset handling
fixes #1659, fixes #1668

- removed relative asset url from css
- added asset helper to client
- updated references to shared assets
- added functional tests
2013-12-28 18:29:33 +00:00