Commit 22869bdfb5d56a0801fd8ca9e5f670fb1e428bea
1 parent
27d5757f
Exists in
colab
and in
4 other branches
Removed unused JavaScript for project state retrieval
Signed off by: Heitor Reis <marcheing@gmail.com>
Showing
3 changed files
with
1 additions
and
21 deletions
Show diff stats
app/controllers/repositories_controller.rb
@@ -71,9 +71,7 @@ class RepositoriesController < ApplicationController | @@ -71,9 +71,7 @@ class RepositoriesController < ApplicationController | ||
71 | end | 71 | end |
72 | 72 | ||
73 | respond_to do |format| | 73 | respond_to do |format| |
74 | - if @processing.nil? | ||
75 | - format.js { render action: 'unprocessed' } | ||
76 | - elsif @processing.state == 'READY' | 74 | + if @processing.state == 'READY' |
77 | format.js { render action: 'load_ready_processing' } | 75 | format.js { render action: 'load_ready_processing' } |
78 | elsif @processing.state == 'ERROR' | 76 | elsif @processing.state == 'ERROR' |
79 | format.js { render action: 'load_error' } | 77 | format.js { render action: 'load_error' } |
app/views/repositories/unprocessed.js.erb
@@ -1,6 +0,0 @@ | @@ -1,6 +0,0 @@ | ||
1 | -// This if prevents it from updating the repository's state after the user leaves its page | ||
2 | -if(document.URL == '<%= project_repository_url(@repository.project_id, @repository) %>'){ | ||
3 | - $('div#processing_information').html('<%= escape_javascript(render partial: "unstarted_processing") %>'); | ||
4 | - repository = new Module.Repository(<%= @repository.project_id %>, <%= @repository.id %>) | ||
5 | - repository.schedule_poll_state('') | ||
6 | -} |
spec/controllers/repositories_controller_spec.rb
@@ -246,18 +246,6 @@ describe RepositoriesController, :type => :controller do | @@ -246,18 +246,6 @@ describe RepositoriesController, :type => :controller do | ||
246 | describe 'state' do | 246 | describe 'state' do |
247 | let(:repository) { FactoryGirl.build(:repository) } | 247 | let(:repository) { FactoryGirl.build(:repository) } |
248 | 248 | ||
249 | - context 'with no processing at all' do | ||
250 | - before :each do | ||
251 | - repository.expects(:last_processing).returns(nil) | ||
252 | - Repository.expects(:find).at_least_once.with(repository.id).returns(repository) | ||
253 | - | ||
254 | - xhr :get, :state, {project_id: project.id.to_s, id: repository.id, last_state: ''} | ||
255 | - end | ||
256 | - | ||
257 | - it { is_expected.to respond_with(:success) } | ||
258 | - it { is_expected.to render_template(:unprocessed) } | ||
259 | - end | ||
260 | - | ||
261 | context 'with a READY state' do | 249 | context 'with a READY state' do |
262 | let(:ready_processing) { FactoryGirl.build(:processing) } | 250 | let(:ready_processing) { FactoryGirl.build(:processing) } |
263 | 251 |