Permalink
Browse files

Uprava nastaveni e2e testu pro angular

  • Loading branch information...
1 parent b82cdd1 commit b10de9eccb4bf04d9cddcde50b0a49cfd1ded028 @JakubMrozek committed Dec 5, 2012
View
1 public/js/apiary.js
@@ -1 +0,0 @@
-var apiary = [{"name":"Stranky","description":"","resources":[{"description":"Vrácení seznamu všech stránek.","method":"GET","url":"/pages","request":{"headers":{},"body":""},"responses":[{"status":200,"headers":{"Content-Type":"application/json"},"body":"[\n{\"id\":\"5098eaef0496600200000001\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Kontakt\",\n\"url\":\"kontakt\"},\n{\"id\":\"5098eaef0496600200000002\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Obchodní podmínky\",\n\"url\":\"obchodni-podminky\"},\n{\"id\":\"5098eaef0496600200000003\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Doprava a platba\",\n\"url\":\"doprava a platba\"}\n]"}]},{"description":"Zobrazení detailu jedné stránky.","method":"GET","url":"/pages/{id}","request":{"headers":{},"body":""},"responses":[{"status":200,"headers":{"Content-Type":"application/json"},"body":"{\"id\":\"5098eaef0496600200000001\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Kontakt\",\n\"url\":\"kontakt\"}"}]},{"description":"Vložení nové stránky do databáze.","method":"POST","url":"/pages","request":{"headers":{"Content-Type":"application/json"},"body":"{\"content\":\"Lorem ipsum set dolorem\", \"title\":\"Nákupní řád\"}"},"responses":[{"status":201,"headers":{"Location":"//api/v1/pages/nakupni-rad"},"body":""}]},{"description":"Editace jedné stránky v databázi.","method":"PUT","url":"/pages/{id}","request":{"headers":{"Content-Type":"application/json"},"body":"{\"content\":\"Lorem ipsum set dolorem\", \n\"title\":\"Nákupní řád e-shopu\"}"},"responses":[{"status":200,"headers":{"Content-Type":"application/json"},"body":"{\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Nákupní řád e-shopu\"}"}]},{"description":"Smazání stránky z databáze.","method":"DELETE","url":"/pages/{id}","request":{"headers":{},"body":""},"responses":[{"status":204,"headers":{},"body":""}]}]}]
View
14 public/js/directives.js
@@ -3,7 +3,7 @@
/* Directives */
/**
- * <inline value='page.text' action='updateDb()'/>
+ * <inline model='page.text' action='updateDb()'/>
*/
zdrojak.directive('inline', function(){
var KEY_CODE_ENTER = 13;
@@ -12,14 +12,14 @@ zdrojak.directive('inline', function(){
replace: true,
scope: {
action: '=action',
- value: '=value',
- textarea: '=textarea'
+ model: '=model',
+ textarea: '@textarea'
},
template:
'<div>' +
- '<span ng-hide="mode">{{value}}</span>' +
- '<input type="text" ng-show="mode && !textarea" ng-model="value" required>' +
- '<textarea ng-show="mode && textarea" ng-model="value"></textarea>' +
+ '<span ng-hide="mode">{{model}}</span>' +
+ '<input type="text" ng-show="mode && !textarea" ng-model="model" required>' +
+ '<textarea ng-show="mode && textarea" ng-model="model"></textarea>' +
'</div>',
link: function(scope, element) {
var children = element.children();
@@ -33,7 +33,7 @@ zdrojak.directive('inline', function(){
//zmenit editaci na text a zavolat akci po editaci
function send() {
var newContent = element.text().trim();
- if (newContent) {
+ if (newContent !== '') {
scope.$apply('mode=false');
}
if (newContent !== oldContent) {
View
0 public/index.html → public/partials/layout.html
File renamed without changes.
View
4 public/partials/pages/show.html
@@ -1,7 +1,7 @@
-<h1><inline value='page.title' action='update'></inline></h1>
+<h1><inline model='page.title' action='update'></inline></h1>
-<p><inline value='page.content' textarea='true' action='update'></inline></p>
+<p><inline model='page.content' textarea='true' action='update'></inline></p>
<ul>
<li><a ng-click="remove()">Smazat</a></li>
View
1 test/frontend/apiary.js
@@ -1 +0,0 @@
-var apiary = [{"name":"Stranky","description":"","resources":[{"description":"Vrácení seznamu všech stránek.","method":"GET","url":"/pages","request":{"headers":{},"body":""},"responses":[{"status":200,"headers":{"Content-Type":"application/json"},"body":"[\n{\"id\":\"5098eaef0496600200000001\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Kontakt\",\n\"url\":\"kontakt\"},\n{\"id\":\"5098eaef0496600200000002\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Obchodní podmínky\",\n\"url\":\"obchodni-podminky\"},\n{\"id\":\"5098eaef0496600200000003\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Doprava a platba\",\n\"url\":\"doprava a platba\"}\n]"}]},{"description":"Zobrazení detailu jedné stránky.","method":"GET","url":"/pages/{id}","request":{"headers":{},"body":""},"responses":[{"status":200,"headers":{"Content-Type":"application/json"},"body":"{\"id\":\"5098eaef0496600200000001\",\n\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Kontakt\",\n\"url\":\"kontakt\"}"}]},{"description":"Vložení nové stránky do databáze.","method":"POST","url":"/pages","request":{"headers":{"Content-Type":"application/json"},"body":"{\"content\":\"Lorem ipsum set dolorem\", \"title\":\"Nákupní řád\"}"},"responses":[{"status":201,"headers":{"Location":"//api/v1/pages/nakupni-rad"},"body":""}]},{"description":"Editace jedné stránky v databázi.","method":"PUT","url":"/pages/{id}","request":{"headers":{"Content-Type":"application/json"},"body":"{\"content\":\"Lorem ipsum set dolorem\", \n\"title\":\"Nákupní řád e-shopu\"}"},"responses":[{"status":200,"headers":{"Content-Type":"application/json"},"body":"{\"content\":\"Lorem ipsum set dolorem\",\n\"title\":\"Nákupní řád e-shopu\"}"}]},{"description":"Smazání stránky z databáze.","method":"DELETE","url":"/pages/{id}","request":{"headers":{},"body":""},"responses":[{"status":204,"headers":{},"body":""}]}]}]
View
1 test/frontend/e2e/scenarios.js
@@ -2,7 +2,6 @@
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */
-//rekne aplikaci, aby pracovala s mocky
var scenario = true;
describe('zdrojak', function() {

0 comments on commit b10de9e

Please sign in to comment.