Permalink
Browse files

Pridany testovaci scenare pro inline editace

  • Loading branch information...
1 parent 60d18bd commit b82cdd1fa5ddc6bed828baff4a24d748fc7485f6 @JakubMrozek committed Dec 3, 2012
Showing with 38 additions and 3 deletions.
  1. +2 −1 public/js/services.js
  2. +36 −2 test/frontend/e2e/scenarios.js
@@ -20,10 +20,11 @@ mock.run(function($httpBackend) {
var resources = apiary[0].resources;
resources.forEach(function(res){
- var url = '/api/v1' + res.url.replace('{id}', ':id');
+ var url = '/api/v1' + res.url.replace('{id}', 'test');
switch (res.method) {
case 'GET':
$httpBackend.whenGET(url).respond(res.responses[0].body);
+ console.log(url);
break;
case 'POST':
$httpBackend.whenPOST(url).respond(res.responses[0].body);
@@ -8,7 +8,7 @@ var scenario = true;
describe('zdrojak', function() {
describe('/pages', function() {
-
+
beforeEach(function() {
browser().navigateTo('/pages');
});
@@ -17,6 +17,40 @@ describe('zdrojak', function() {
var repeater = using('#pages-list').repeater('ul li');
expect(repeater.count()).toBe(3);
});
-
+
});
+
+ describe('/pages/:page', function() {
+
+ beforeEach(function() {
+ browser().navigateTo('/pages/test');
+ });
+
+ it('zobrazi detail stranky', function() {
+ expect(element('h1').text()).toBe('Kontakt');
+ });
+
+ it('edituje nazev stranky', function() {
+ var h1Elm = element('h1');
+ var spanElm = element('h1 span');
+ var inputElm = element('h1 input');
+
+ expect(spanElm.css('display')).not().toBe('none');
+ expect(inputElm.css('display')).toBe('none');
+
+ element('h1 span').click();
+
+ expect(spanElm.css('display')).toBe('none');
+ expect(inputElm.css('display')).not().toBe('none');
+
+ input('value').enter('test');
+
+ expect(h1Elm.text()).toBe('test');
+
+ });
+
+ });
+
+
+
});

0 comments on commit b82cdd1

Please sign in to comment.