Commit ecf2212e34829cea0cba8289c7bd392ef85198b3
Committed by
Diego Camarinha
1 parent
26ae59a4
Exists in
colab
and in
4 other branches
processing_with_date fixed for kalibro_client version 1
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/controllers/repositories_controller.rb
| @@ -73,7 +73,7 @@ class RepositoriesController < ApplicationController | @@ -73,7 +73,7 @@ class RepositoriesController < ApplicationController | ||
| 73 | # POST /projects/1/repositories/1/state_with_date | 73 | # POST /projects/1/repositories/1/state_with_date |
| 74 | def state_with_date | 74 | def state_with_date |
| 75 | year, month, day = params[:year], params[:month], params[:day] | 75 | year, month, day = params[:year], params[:month], params[:day] |
| 76 | - @processing = Processing.processing_with_date_of(@repository.id, "#{year}-#{month}-#{day}") | 76 | + @processing = @repository.processing_with_date("#{year}-#{month}-#{day}") |
| 77 | 77 | ||
| 78 | respond_to_processing_state | 78 | respond_to_processing_state |
| 79 | end | 79 | end |
spec/controllers/repositories_controller_spec.rb
| @@ -389,8 +389,8 @@ describe RepositoriesController, :type => :controller do | @@ -389,8 +389,8 @@ describe RepositoriesController, :type => :controller do | ||
| 389 | let(:repository) { FactoryGirl.build(:repository) } | 389 | let(:repository) { FactoryGirl.build(:repository) } |
| 390 | 390 | ||
| 391 | before :each do | 391 | before :each do |
| 392 | + repository.expects(:processing_with_date).with("2013-11-11").returns(processing) | ||
| 392 | Repository.expects(:find).at_least_once.with(repository.id).returns(repository) | 393 | Repository.expects(:find).at_least_once.with(repository.id).returns(repository) |
| 393 | - Processing.expects(:processing_with_date_of).with(repository.id, "2013-11-11").returns(processing) | ||
| 394 | 394 | ||
| 395 | xhr :get, :state_with_date, {id: repository.id, day: '11', month: '11', year: '2013'} | 395 | xhr :get, :state_with_date, {id: repository.id, day: '11', month: '11', year: '2013'} |
| 396 | end | 396 | end |