Commit ad37222563eb146240a1c1347f546f533c881ac7
Committed by
Heitor
1 parent
aab7ae61
Exists in
colab
and in
4 other branches
Fix syntax error in Javascripts
Signed-off-by: Heitor Reis <marcheing@gmail.com>
Showing
2 changed files
with
19 additions
and
13 deletions
Show diff stats
app/assets/javascripts/repository/state.js.coffee
| ... | ... | @@ -2,15 +2,15 @@ class Repository.State |
| 2 | 2 | constructor: (@project_id, @repository_id) -> |
| 3 | 3 | |
| 4 | 4 | poll_state: (last_state) -> |
| 5 | - $.post '/projects/' + @project_id + '/repositories/' + @repository_id + '/state', | |
| 6 | - last_state: last_state | |
| 5 | + $.post('/projects/' + @project_id + '/repositories/' + @repository_id + '/state', | |
| 6 | + last_state: last_state) | |
| 7 | 7 | |
| 8 | 8 | schedule_poll_state: (last_state) -> |
| 9 | 9 | context = this |
| 10 | 10 | call = () -> |
| 11 | - context.poll_state(last_state) | |
| 11 | + context.poll_state(last_state) | |
| 12 | 12 | |
| 13 | - setTimeout( call, 15000 ) # Delays in 15s the next call | |
| 13 | + setTimeout(call, 15000) # Delays in 15s the next call | |
| 14 | 14 | |
| 15 | 15 | @set_loader: (loading_html) -> |
| 16 | 16 | $('div#processing_information').html(loading_html) |
| 17 | 17 | \ No newline at end of file | ... | ... |
spec/javascripts/repository/branch_spec.js.coffee
| 1 | 1 | #= require application |
| 2 | -#= require 'sinon' | |
| 2 | +#= require sinon | |
| 3 | 3 | |
| 4 | 4 | describe "Branch#constructor", -> |
| 5 | 5 | it "should construct a branch", -> |
| ... | ... | @@ -8,23 +8,29 @@ describe "Branch#constructor", -> |
| 8 | 8 | assert.isNull(subject.request) |
| 9 | 9 | |
| 10 | 10 | describe "toggle", -> |
| 11 | - @subject = new Repository.Branch() | |
| 12 | - beforeEach -> | |
| 11 | + before -> | |
| 12 | + @subject = new Repository.Branch() | |
| 13 | + | |
| 13 | 14 | @combo_box = sinon.stub() |
| 14 | 15 | $ = sinon.stub(window, "$") |
| 15 | 16 | $.withArgs("#branches").returns(@combo_box) |
| 17 | + | |
| 16 | 18 | context "scm_type = SVN", -> |
| 17 | - @combo_box.hide = sinon.spy() | |
| 18 | - it "should hide the branches combo box", -> | |
| 19 | + before -> | |
| 20 | + @combo_box.hide = sinon.spy() | |
| 19 | 21 | $.withArgs("#repository_scm_type").returns({val: -> "SVN"}) |
| 22 | + | |
| 23 | + it "should hide the branches combo box", -> | |
| 20 | 24 | @subject.toggle() |
| 21 | 25 | assert.isTrue(@combo_box.hide.calledOnce) |
| 26 | + | |
| 22 | 27 | context "scm_type != SVN", -> |
| 23 | - @combo_box.show = sinon.spy() | |
| 28 | + before -> | |
| 29 | + @combo_box.show = sinon.spy() | |
| 24 | 30 | $.withArgs("#repository_address").returns({val: -> "https://github.com/mezuro/prezento.git"}) |
| 25 | - sinon.stub(@subject, "fetch").withArgs("https://github.com/mezuro/prezento.git") | |
| 26 | - @subject.stub = sinon.spy() | |
| 27 | - it "should show the branches combo box", -> | |
| 28 | 31 | $.withArgs("#repository_scm_type").returns({val: -> "GIT"}) |
| 32 | + sinon.stub(@subject, "fetch").withArgs("https://github.com/mezuro/prezento.git") | |
| 33 | + | |
| 34 | + it "should show the branches combo box", -> | |
| 29 | 35 | @subject.toggle() |
| 30 | 36 | assert.isTrue(@combo_box.show.calledOnce) | ... | ... |