Commit e595da65f91438f3f5f60c5cb05e877fca9b012d
Committed by
Diego Camarinha
1 parent
7c444dce
Exists in
master
and in
28 other branches
[Mezuro] Fixed some bugs
Showing
3 changed files
with
13 additions
and
6 deletions
Show diff stats
plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb
... | ... | @@ -22,7 +22,7 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController |
22 | 22 | |
23 | 23 | if( repository.errors.empty? ) |
24 | 24 | repository.process |
25 | - redirect_to "/profile/#{profile.identifier}/plugin/mezuro/repository/show/#{project_content.id}?repository_id=#{project_content.id}" | |
25 | + redirect_to "/profile/#{profile.identifier}/plugin/mezuro/repository/show/#{project_content.id}?repository_id=#{repository.id}" | |
26 | 26 | else |
27 | 27 | redirect_to_error_page repository.errors[0].message |
28 | 28 | end |
... | ... | @@ -47,9 +47,9 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController |
47 | 47 | |
48 | 48 | repository = Kalibro::Repository.new( params[:repository] ) |
49 | 49 | repository.save(project_content.project_id) |
50 | - | |
50 | + | |
51 | 51 | if( repository.errors.empty? ) |
52 | - redirect_to "/profile/#{profile.identifier}/plugin/mezuro/repository/show/#{project_content.id}?repository_id=#{project_content.id}" | |
52 | + redirect_to "/profile/#{profile.identifier}/plugin/mezuro/repository/show/#{project_content.id}?repository_id=#{repository.id}" | |
53 | 53 | else |
54 | 54 | redirect_to_error_page repository.errors[0].message |
55 | 55 | end | ... | ... |
plugins/mezuro/lib/kalibro/range_snapshot.rb
plugins/mezuro/test/functional/profile/mezuro_plugin_processing_controller_test.rb
... | ... | @@ -19,8 +19,15 @@ class MezuroPluginProcessingControllerTest < ActionController::TestCase |
19 | 19 | end |
20 | 20 | |
21 | 21 | should 'render last processing state' do |
22 | - Kalibro::Processing.expects(:request).with(:last_processing_state, :repository_id => @repository_id).returns({:process_state => @processing.state}) | |
23 | - get :render_last_state, :profile => @profile.identifier, :repository_id => @repository_id | |
22 | + Kalibro::Processing.expects(:processing_of).with(@repository_id).returns(@processing) | |
23 | + get :state, :profile => @profile.identifier, :repository_id => @repository_id | |
24 | + assert_response 200 | |
25 | + assert_equal @processing.state, @response.body | |
26 | + end | |
27 | + | |
28 | + should 'render a processing state in a specific date' do | |
29 | + Kalibro::Processing.expects(:processing_with_date_of).with(@repository_id, @processing.date).returns(@processing) | |
30 | + get :state, :profile => @profile.identifier, :repository_id => @repository_id, :date => @processing.date | |
24 | 31 | assert_response 200 |
25 | 32 | assert_equal @processing.state, @response.body |
26 | 33 | end | ... | ... |