diff --git a/test/e2e/scenarios.coffee b/test/e2e/scenarios.coffee index 455a3ab..f6d267c 100644 --- a/test/e2e/scenarios.coffee +++ b/test/e2e/scenarios.coffee @@ -1,29 +1,3 @@ -angular.scenario.dsl 'scope', -> - (ctrl, arg = null) -> - futureName = - if !arg? - "scope in Controller '#{ctrl}'" - else if typeof arg == 'function' - "executing 'scope.$apply(#{arg})' in Controller '#{ctrl}'" - else - "scope variable '#{arg}' in Controller '#{ctrl}'" - @addFutureAction futureName - , ($window, $document, done) -> - elmt = $window.$ "[ng-controller='#{ctrl}']" - return done("No Controller #{ctrl}") unless elmt? - sc = elmt.scope() - return done(null, sc) unless arg? - if typeof arg == 'string' - parts = arg.split '.' - for p in parts - sc = sc[p] - done(null, sc) - else if typeof arg == 'function' - sc.$apply -> arg(sc) - done() - else - done "don't understand argument #{arg}" - describe 'module contenteditable', -> describe 'directive contenteditable', -> describe 'simple application', -> @@ -33,22 +7,18 @@ describe 'module contenteditable', -> it 'should update the model from the view (simple text)', -> element('#input').enter('abc') expect(element('#input').html()).toBe 'abc' - expect(scope('Ctrl', 'model')).toBe 'abc' expect(element('#output').html()).toBe 'abc' it 'should update the model from the view (text with spans)', -> element('#input').html('abc red') - expect(scope('Ctrl', 'model')).toBe 'abc red' expect(element('#input span').html()).toBe 'red' expect(element('#output').html()).toBe 'abc <span style="color:red">red</span>' it 'should update the view from the model', -> - expect(scope('Ctrl', 'model')).toBe 'Initial stuff with bold and italic yay' - scope('Ctrl', ($scope) -> $scope.model = 'oops') - expect(scope('Ctrl', 'model')).toBe 'oops' + input('model').enter('oops') expect(element('#input').html()).toBe 'oops' - scope('Ctrl', ($scope) -> $scope.model = 'a red b') + expect(element('#output').html()).toBe 'oops' + input('model').enter('a red b') expect(element('#input').html()).toBe 'a red b' expect(element('#input span').html()).toBe 'red' - ## Why doesn't it work on this one??!! - # expect(element('#output').html()).toBe 'oops' + expect(element('#output').html()).toBe 'a <span style="color:red">red</span> b' diff --git a/test/fixtures/simple.html b/test/fixtures/simple.html index 1a90794..4291d5f 100644 --- a/test/fixtures/simple.html +++ b/test/fixtures/simple.html @@ -1,9 +1,7 @@ - +r Simple - -