From e595da65f91438f3f5f60c5cb05e877fca9b012d Mon Sep 17 00:00:00 2001 From: Alessandro Palmeira + Diego Araújo Date: Thu, 20 Dec 2012 18:07:40 -0200 Subject: [PATCH] [Mezuro] Fixed some bugs --- plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb | 6 +++--- plugins/mezuro/lib/kalibro/range_snapshot.rb | 2 +- plugins/mezuro/test/functional/profile/mezuro_plugin_processing_controller_test.rb | 11 +++++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb b/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb index e7a341c..92c457d 100644 --- a/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb +++ b/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb @@ -22,7 +22,7 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController if( repository.errors.empty? ) repository.process - redirect_to "/profile/#{profile.identifier}/plugin/mezuro/repository/show/#{project_content.id}?repository_id=#{project_content.id}" + redirect_to "/profile/#{profile.identifier}/plugin/mezuro/repository/show/#{project_content.id}?repository_id=#{repository.id}" else redirect_to_error_page repository.errors[0].message end @@ -47,9 +47,9 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController repository = Kalibro::Repository.new( params[:repository] ) repository.save(project_content.project_id) - + if( repository.errors.empty? ) - redirect_to "/profile/#{profile.identifier}/plugin/mezuro/repository/show/#{project_content.id}?repository_id=#{project_content.id}" + redirect_to "/profile/#{profile.identifier}/plugin/mezuro/repository/show/#{project_content.id}?repository_id=#{repository.id}" else redirect_to_error_page repository.errors[0].message end diff --git a/plugins/mezuro/lib/kalibro/range_snapshot.rb b/plugins/mezuro/lib/kalibro/range_snapshot.rb index 2b16020..b9a30c8 100644 --- a/plugins/mezuro/lib/kalibro/range_snapshot.rb +++ b/plugins/mezuro/lib/kalibro/range_snapshot.rb @@ -1,5 +1,5 @@ class Kalibro::RangeSnapshot < Kalibro::Model - attr_accessor :end, :label, :grade, :color, :comments + attr_accessor :beginning, :end, :label, :grade, :color, :comments end diff --git a/plugins/mezuro/test/functional/profile/mezuro_plugin_processing_controller_test.rb b/plugins/mezuro/test/functional/profile/mezuro_plugin_processing_controller_test.rb index 967b859..9daea82 100644 --- a/plugins/mezuro/test/functional/profile/mezuro_plugin_processing_controller_test.rb +++ b/plugins/mezuro/test/functional/profile/mezuro_plugin_processing_controller_test.rb @@ -19,8 +19,15 @@ class MezuroPluginProcessingControllerTest < ActionController::TestCase end should 'render last processing state' do - Kalibro::Processing.expects(:request).with(:last_processing_state, :repository_id => @repository_id).returns({:process_state => @processing.state}) - get :render_last_state, :profile => @profile.identifier, :repository_id => @repository_id + Kalibro::Processing.expects(:processing_of).with(@repository_id).returns(@processing) + get :state, :profile => @profile.identifier, :repository_id => @repository_id + assert_response 200 + assert_equal @processing.state, @response.body + end + + should 'render a processing state in a specific date' do + Kalibro::Processing.expects(:processing_with_date_of).with(@repository_id, @processing.date).returns(@processing) + get :state, :profile => @profile.identifier, :repository_id => @repository_id, :date => @processing.date assert_response 200 assert_equal @processing.state, @response.body end -- libgit2 0.21.2