From e7e0fe1f3db18ccfb69d3c003806d09e6a03dfa8 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Mon, 2 Jul 2012 12:25:40 -0400 Subject: [PATCH] Fix element naming convention --- .../coffee/spec/modules/problem_spec.coffee | 28 +++++++-------- .../coffee/spec/modules/sequence_spec.coffee | 8 ++--- .../coffee/spec/modules/tab_spec.coffee | 6 ++-- .../modules/video/video_caption_spec.coffee | 34 +++++++++---------- .../modules/video/video_control_spec.coffee | 14 ++++---- .../modules/video/video_player_spec.coffee | 24 ++++++------- .../video/video_progress_slider_spec.coffee | 16 ++++----- .../video/video_speed_control_spec.coffee | 10 +++--- .../video/video_volume_control_spec.coffee | 6 ++-- .../coffee/spec/modules/video_spec.coffee | 2 +- lms/static/coffee/src/_subview.coffee | 2 +- lms/static/coffee/src/main.coffee | 4 +-- lms/static/coffee/src/modules/problem.coffee | 18 +++++----- lms/static/coffee/src/modules/sequence.coffee | 14 ++++---- lms/static/coffee/src/modules/tab.coffee | 10 +++--- lms/static/coffee/src/modules/video.coffee | 2 +- .../src/modules/video/video_caption.coffee | 8 ++--- .../src/modules/video/video_control.coffee | 2 +- .../src/modules/video/video_player.coffee | 20 +++++------ .../video/video_progress_slider.coffee | 2 +- .../modules/video/video_speed_control.coffee | 2 +- .../modules/video/video_volume_control.coffee | 2 +- 22 files changed, 117 insertions(+), 117 deletions(-) diff --git a/lms/static/coffee/spec/modules/problem_spec.coffee b/lms/static/coffee/spec/modules/problem_spec.coffee index 7537cd3493..48d63784d6 100644 --- a/lms/static/coffee/spec/modules/problem_spec.coffee +++ b/lms/static/coffee/spec/modules/problem_spec.coffee @@ -20,7 +20,7 @@ describe 'Problem', -> @problem = new Problem 1, '/problem/url/' it 'set the element', -> - expect(@problem.element).toBe '#problem_1' + expect(@problem.el).toBe '#problem_1' describe 'bind', -> beforeEach -> @@ -69,7 +69,7 @@ describe 'Problem', -> @problem.render 'Hello World' it 'render the content', -> - expect(@problem.element.html()).toEqual 'Hello World' + expect(@problem.el.html()).toEqual 'Hello World' it 're-bind the content', -> expect(@problem.bind).toHaveBeenCalled() @@ -81,7 +81,7 @@ describe 'Problem', -> @problem.render() it 'load the content via ajax', -> - expect(@problem.element.html()).toEqual 'Hello World' + expect(@problem.el.html()).toEqual 'Hello World' it 're-bind the content', -> expect(@problem.bind).toHaveBeenCalled() @@ -104,13 +104,13 @@ describe 'Problem', -> it 'call render with returned content', -> spyOn($, 'postWithPrefix').andCallFake (url, answers, callback) -> callback(success: 'correct', contents: 'Correct!') @problem.check() - expect(@problem.element.html()).toEqual 'Correct!' + expect(@problem.el.html()).toEqual 'Correct!' describe 'when the response is incorrect', -> it 'call render with returned content', -> spyOn($, 'postWithPrefix').andCallFake (url, answers, callback) -> callback(success: 'incorrect', contents: 'Correct!') @problem.check() - expect(@problem.element.html()).toEqual 'Correct!' + expect(@problem.el.html()).toEqual 'Correct!' describe 'when the response is undetermined', -> it 'alert the response', -> @@ -137,16 +137,16 @@ describe 'Problem', -> spyOn($, 'postWithPrefix').andCallFake (url, answers, callback) -> callback html: "Reset!" @problem.reset() - expect(@problem.element.html()).toEqual 'Reset!' + expect(@problem.el.html()).toEqual 'Reset!' describe 'show', -> beforeEach -> @problem = new Problem 1, '/problem/url/' - @problem.element.prepend '
' + @problem.el.prepend '
' describe 'when the answer has not yet shown', -> beforeEach -> - @problem.element.removeClass 'showed' + @problem.el.removeClass 'showed' it 'log the problem_show event', -> @problem.show() @@ -172,11 +172,11 @@ describe 'Problem', -> it 'add the showed class to element', -> spyOn($, 'postWithPrefix').andCallFake (url, callback) -> callback(answers: {}) @problem.show() - expect(@problem.element).toHaveClass 'showed' + expect(@problem.el).toHaveClass 'showed' describe 'multiple choice question', -> beforeEach -> - @problem.element.prepend ''' + @problem.el.prepend ''' @@ -194,8 +194,8 @@ describe 'Problem', -> describe 'when the answers are alreay shown', -> beforeEach -> - @problem.element.addClass 'showed' - @problem.element.prepend ''' + @problem.el.addClass 'showed' + @problem.el.prepend '''