Commit ad7f5933f370da71905b5fbff77c1f4ccf63f1f4
Committed by
João M. M. da Silva
1 parent
4c6d2a81
Exists in
master
and in
29 other branches
[Mezuro] refactoring repository_controller
Showing
2 changed files
with
7 additions
and
7 deletions
Show diff stats
plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb
1 | 1 | #TODO terminar esse controler e seus testes funcionais |
2 | -#TODO falta o destroy | |
3 | 2 | class MezuroPluginRepositoryController < MezuroPluginProfileController |
4 | 3 | |
5 | 4 | append_view_path File.join(File.dirname(__FILE__) + '/../../views') |
... | ... | @@ -56,15 +55,16 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController |
56 | 55 | end |
57 | 56 | end |
58 | 57 | |
59 | - def show | |
58 | + def show #TODO verificar data_content e data_profile | |
60 | 59 | project_content = profile.articles.find(params[:id]) |
61 | 60 | @project_name = project_content.name |
62 | 61 | @repository = project_content.repositories.select{ |repository| repository.id == params[:repository_id].to_s }.first |
63 | 62 | @configuration_name = Kalibro::Configuration.configuration_of(@repository.id).name |
64 | - @processing = Kalibro::Processing.processing_of(@repository.id) | |
63 | + @data_profile = project_content.profile.identifier | |
64 | + @data_content = project_content.id | |
65 | 65 | end |
66 | 66 | |
67 | - def destroy | |
67 | + def destroy #TODO verificar se está correto | |
68 | 68 | project_content = profile.articles.find(params[:id]) |
69 | 69 | repository = project_content.repositories.select{ |repository| repository.id == params[:repository_id].to_s }.first |
70 | 70 | repository.destroy | ... | ... |
plugins/mezuro/test/functional/profile/mezuro_plugin_repository_controller_test.rb
... | ... | @@ -87,14 +87,14 @@ class MezuroPluginRepositoryControllerTest < ActionController::TestCase |
87 | 87 | assert_response :redirect |
88 | 88 | end |
89 | 89 | |
90 | - should 'show a repository' do | |
90 | + should 'set variables to show a repository' do #TODO Terminar esse teste | |
91 | 91 | Kalibro::Repository.expects(:repositories_of).with(@content.project_id).returns([@repository]) |
92 | 92 | Kalibro::Configuration.expects(:configuration_of).with(@repository.id).returns(@configuration) |
93 | 93 | |
94 | 94 | assert_equal @content.name, assigns(:project_name) |
95 | 95 | assert_equal @repository, assigns(:repository) |
96 | - @configuration_name = Kalibro::Configuration.find(@repository.configuration_id).name | |
97 | - @processing = processing(@repository.id) | |
96 | +# @configuration_name = Kalibro::Configuration.find(@repository.configuration_id).name | |
97 | +# @processing = processing(@repository.id) | |
98 | 98 | end |
99 | 99 | |
100 | 100 | end | ... | ... |