Commit Graph

38 Commits

Author SHA1 Message Date
mleanos
99e5803eae Fix client-side tests after removing <base/>
Fixes the client-side tests after the removal of the <base/> tag from
the main layout.

These fixes aren't ideal. At the moment, they will suffice. This comment
(https://github.com/angular-ui/ui-router/issues/212#issuecomment-60803437),
among others in that issue, led me to choose this method as the fix to
avoid having to change any other core code.
2016-10-10 17:11:25 -07:00
mleanos
c065246a23 Update path in tests
Updated tests to account for new "/" prefix in the path.
2016-10-10 16:05:10 -07:00
Cameron Behar
aebaf2ff74 fix(core): Remove the <base> tag. 2016-10-10 16:05:10 -07:00
Michael Leanos
0ea8cec120 fix(express): Incorrest uses of 400 error codes (#1553)
Fixes incorrest usage of 400 HTTP responses being returned from the
server, in favor of using 422.

Also, changed a few return codes to 401 where it was more appropriate.

See this article for reasoning behind moving to 422, and why 400 isn't
appropriate for these cases.

For ref:
6be12f8a06

Related:
https://github.com/meanjs/mean/pull/1547
https://github.com/meanjs/mean/pull/1510
2016-10-10 16:00:24 -07:00
Sujeeth
607ed061e3 feat(core): add notification feedback with angular-ui-notification (#1532)
Added visual notification for user/article updates
angular-ui-notification config added to core client config
Notification idea from #369
2016-10-10 14:51:44 -07:00
itelo
6a6b630292 feat(users): change username to usernameOrEmail in signin (#1545)
* feat(users): change username to usernameOrEmail in signin

* fix(users): toLowerCase at email in local strategy
2016-10-06 18:34:15 +03:00
Mikael Korpela
c35713d352 fix(core): Fixes issues with tests and Node v6 (#1458)
Fixes issues with Mocha tests and Node v6.

Related to #1455
2016-08-28 14:30:27 +03:00
Michael Leanos
c96f8c0b56 fix(articles): Article controllers name conflicts (#1428)
* fix(articles): Article controllers name conflicts

Fixes the naming conflicts for the Articles controllers.

Due to how Angular injects the controllers into the StateProvider,
naming conflicts were caused between the Articles public & admin module
controllers.

To resolve the issue the referenced controllers in the Articles admin
route configurations must be unique, and match up with the Admin
controllers.

* Client-side tests failing

Fixed the client-side tests that were failing due to the naming
conflicts.
2016-08-26 13:27:43 +03:00
Michael Leanos
89075cb8d3 feat(articles): Article Admin feature (#807)
This feature introduces a breaking change, that restricts the User's that
can create/edit/delete Articles to only those that have the `admin` Role.

Fixed ESLint issues.

Resolved merge conflicts, and moved new client Article Service
`createOrUpdate` functionality to new Admin feature controller.

Removed edit functionality from client-side Article controller.
2016-07-25 17:34:06 -07:00
Marek Grzybek
d14d5130af feat(config): Deprecate JSHint in favor of ESLint
Add basic ESLint setup extending well-known Airbnb code style.

Fixes #1072, #1097
2016-03-15 19:11:12 +01:00
mleanos
b00498629c fix(core): Remove trailing slash from routes
Adds an angular $urlRouterProvider service Rule to the Core module
configuration, that removes any trailing slashes in the URL for all routes.

The Rule is defined in the core routes configuration. Thus, in order for
this to work on all routes in the application, we have to inject the Core
module into each client module, as a dependecy in the client.module
configuration. Otherwise, we'd have to define the Rule in each module's route
configuration individually.

Adds missing client-side route configuration tests.

Tests demonstrate that the various route configurations can handle a trailing
slash in the URL, and gets resolved to the correct client route.

Fixes #1075
2016-03-06 20:56:29 -08:00
Ryan Hutchison
a014ffca9f feat(articles): Rename list.articles.client.controller.js to list-articles.client.controller.js
Closes #1192
2016-02-11 00:36:02 -05:00
mleanos
69b8a05ea2 fix(articles): Article edit/delete validation
Adds a custom field named `isCurrentUserOwner` to the Article document before
it's returned to the client. This field is used to determine if the current
User should is the "owner", and should see the edit/delete controls on the
client-side when viewing a single article. This custom (ad-hoc) field is NOT
persisted to the database; it's merely attached to the document.

Added server-side route tests for verifying the ad-hoc
"isCurrentUserOwner" field is properly set on the a single Article document.

Fixes #1146
2016-02-07 21:29:18 -08:00
Ryan Hutchison
b3ad56efa3 feat(articles): Modify articles module to implement style guidelines.
Update the articles module to implement the style guidelines.

Much of this work is from @trainerbill

Closes #874
Closes #339
2016-01-02 01:53:59 -05:00
mleanos
2bdde4e9e2 fix(articles): Orphaned User reference throws server error
Adds an additional check for the existence of a populated user
reference, when determining if the current user has immediate access to
the requested article.

Without this fix, the server will throw an error if the requested
article doesn't have a populated user field.

Modified the article & articles list view's to check if the article has
a populated user. If not, then it will display "Deleted User" in place
of the missing user reference.

Added a server-side test that ensures we can get a single article if
the article.user field is referencing a deleted user.

Fixes #1082
2015-12-21 19:40:25 -08:00
mleanos
037878b4ba Global Mocha timeout
Added the timeout option to the Mocha grunt task; set to 10000.

Removed the individual test suite timeouts, for all server tests.

Also, added global timeout for Mocha gulp task.
2015-10-10 23:52:08 -07:00
Ilan Biala
7a9ee53357 Merge pull request #939 from jloveland/e2e-tests-fix
Fix grunt and gulp e2e tests, Fixes #929
2015-10-04 12:49:42 -04:00
mleanos
3b375e62d8 Mocha test timeouts [fixes #955]
Added a timeout of 10000 ms to each server test file. This is an attempt
to solve the timeout issues that we're experiencing with the Mocha
tests. Especially, this is hoping to address the build fails that are
caused by such timeouts.

Issue is described in https://github.com/meanjs/mean/issues/955
2015-09-30 19:50:07 -07:00
jloveland
fdf1ad571b fixing grunt and gulp e2e tests 2015-09-29 08:21:43 -04:00
jloveland
1fd6bb6119 adding stronger password requirements for improving security based on OWASP 2015-09-07 22:11:02 -04:00
Liran Tal
70513452b0 Merge pull request #811 from lirantal/feature/code-coverage
Adding coverage report for server-side tests using istanbul
2015-09-01 16:22:36 +03:00
Ryan Hutchison
801547602b client-side form validation with ng-messages.
remove data prefix from attributes.

fix tests
2015-08-25 02:02:18 -04:00
Liran Tal
7252032007 Adding coverage report for server-side tests using istanbul 2015-08-16 00:19:52 +03:00
Ryan Hutchison
ef3a3f9548 formatting reboot (space-2 and consistency)
JSCS fixes

update editorconfig
2015-07-31 10:04:02 -04:00
Ilan Biala
612a76cda6 Merge pull request #728 from cdriscol/angular_tests
Add client side tests
Fixes #663
2015-07-29 10:31:29 -04:00
Liran Tal
09870db9ce Merge pull request #720 from vaucouleur/getErrorMessage
Article middleware was calling getErrorMessage with a null argument
2015-07-29 16:53:54 +03:00
cdriscol
d5ea5c99d2 Adding client test coverage. 2015-07-29 06:51:38 -06:00
Sebastien Vaucouleur
71167b0e75 The article middleware was calling getErrorMessage with a null argument, causing a crash when this method tried to access 'code' on an null parameter.
The bug was not exposed by the original test, since it was mixing two (related) aspects:

* An invalid Id (a badly formed mongodb identifier)
* An non-existent Id (an identifier with no corresponding document in the database)

Modifications:

- Fixed the message property in the article controller (the error message follows the wording of the error message in "users.password.server.controller.js", in case of username not found)
- Added a new test to check modifications and avoid regressions
2015-07-28 11:11:10 +02:00
cdriscol
c4685392cf Adding karma-ng-html2js-preprocessor to fix karma tests. Adding user mock to articles tests. 2015-07-26 10:21:49 -06:00
Liran Tal
de3b890f9d removed /#! in user controllers
Resolved 0.4.0 related conflicts:
	modules/users/server/controllers/users/users.authentication.server.controller.js
2015-07-25 00:39:28 +03:00
Cody B. Daig
a8dae99173 Remove console.log from an article test 2015-07-20 10:04:45 -07:00
Ilan Biala
ade074cf37 Merge pull request #599 from loulin/0.4.0
Add return for done(err) in test
2015-07-09 13:32:27 -04:00
Ryan Hutchison
67e38aec01 fix failing tests 2015-07-07 10:22:21 -04:00
Liran Tal
67e96a4f22 0.4.0 branch merged into master 2015-07-02 12:08:09 +03:00
loulin
d00f4ce0cc should return done(err) in article server route test 2015-06-30 11:15:52 +08:00
Veikko Karsikko
1897ef985b Wait for async saving and removing 2015-02-23 09:33:26 +02:00
Christian Berendt
e027f4025b Add missing newline at the end of text files
On Unix it is common to have a newline at the end of text files.
2015-02-16 21:39:55 +01:00
Amos Haviv
ab81d61bd3 New 0.4 version 2014-11-10 23:12:33 +02:00