diff --git a/plugins/mezuro/controllers/myprofile/mezuro_plugin_reading_controller.rb b/plugins/mezuro/controllers/myprofile/mezuro_plugin_reading_controller.rb index 8c8d361..ac77d00 100644 --- a/plugins/mezuro/controllers/myprofile/mezuro_plugin_reading_controller.rb +++ b/plugins/mezuro/controllers/myprofile/mezuro_plugin_reading_controller.rb @@ -3,10 +3,7 @@ class MezuroPluginReadingController < MezuroPluginMyprofileController append_view_path File.join(File.dirname(__FILE__) + '/../../views') def new - reading_group_content = profile.articles.find(params[:id]) - @reading_group_name = reading_group_content.name - @data_profile = reading_group_content.profile.identifier - @reading_group_content_id = reading_group_content.id + @reading_group_content = profile.articles.find(params[:id]) end def create @@ -21,11 +18,7 @@ class MezuroPluginReadingController < MezuroPluginMyprofileController end def edit - reading_group_content = profile.articles.find(params[:id]) - @reading_group_name = reading_group_content.name - @data_profile = reading_group_content.profile.identifier - @reading_group_content_id = reading_group_content.id - + @reading_group_content = profile.articles.find(params[:id]) @reading = Kalibro::Reading.find params[:reading_id] end diff --git a/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb b/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb index 9fa12b5..2f5cf5f 100644 --- a/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb +++ b/plugins/mezuro/controllers/profile/mezuro_plugin_repository_controller.rb @@ -3,10 +3,7 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController append_view_path File.join(File.dirname(__FILE__) + '/../../views') def new - project_content = profile.articles.find(params[:id]) - @project_name = project_content.name - @data_profile = project_content.profile.identifier - @project_content_id = project_content.id + @project_content = profile.articles.find(params[:id]) @repository_types = Kalibro::Repository.repository_types @@ -32,11 +29,7 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController end def edit - project_content = profile.articles.find(params[:id]) - @project_name = project_content.name - @data_profile = project_content.profile.identifier - @project_content_id = project_content.id - + @project_content = profile.articles.find(params[:id]) @repository_types = Kalibro::Repository.repository_types configurations = Kalibro::Configuration.all @@ -45,7 +38,7 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController [configuration.name,configuration.id] end - @repository = project_content.repositories.select{ |repository| repository.id.to_s == params[:repository_id] }.first + @repository = @project_content.repositories.select{ |repository| repository.id.to_s == params[:repository_id] }.first end def update @@ -63,12 +56,9 @@ class MezuroPluginRepositoryController < MezuroPluginProfileController end def show - project_content = profile.articles.find(params[:id]) - @project_name = project_content.name - @repository = project_content.repositories.select{ |repository| repository.id.to_s == params[:repository_id] }.first + @project_content = profile.articles.find(params[:id]) + @repository = @project_content.repositories.select{ |repository| repository.id.to_s == params[:repository_id] }.first @configuration_name = Kalibro::Configuration.configuration_of(@repository.id).name - @data_profile = project_content.profile.identifier - @data_content = project_content.id end def destroy diff --git a/plugins/mezuro/test/functional/myprofile/mezuro_plugin_reading_controller_test.rb b/plugins/mezuro/test/functional/myprofile/mezuro_plugin_reading_controller_test.rb index ecc0288..280d862 100644 --- a/plugins/mezuro/test/functional/myprofile/mezuro_plugin_reading_controller_test.rb +++ b/plugins/mezuro/test/functional/myprofile/mezuro_plugin_reading_controller_test.rb @@ -22,10 +22,8 @@ class MezuroPluginReadingControllerTest < ActionController::TestCase should 'set variables to create a new reading' do get :new, :profile => @profile.identifier, :id => @content.id - - assert_equal @content.id, assigns(:reading_group_content_id) - assert_equal @content.name, assigns(:reading_group_name) - assert_equal @content.profile.identifier, assigns(:data_profile) + assert_equal @content.id, assigns(:reading_group_content).id + assert_response :success end should 'create a reading' do @@ -47,13 +45,10 @@ class MezuroPluginReadingControllerTest < ActionController::TestCase should 'set variables to edit a reading' do Kalibro::Reading.expects(:find).with(@reading.id.to_s).returns(@reading) - get :edit, :profile => @profile.identifier, :id => @content.id, :reading_id => @reading.id - - assert_equal @content.id, assigns(:reading_group_content_id) - assert_equal @content.name, assigns(:reading_group_name) - assert_equal @content.profile.identifier, assigns(:data_profile) + assert_equal @content.id, assigns(:reading_group_content).id assert_equal @reading, assigns(:reading) + assert_response :success end should 'update a reading' do diff --git a/plugins/mezuro/test/functional/profile/mezuro_plugin_repository_controller_test.rb b/plugins/mezuro/test/functional/profile/mezuro_plugin_repository_controller_test.rb index bb4e4a0..8e26a93 100644 --- a/plugins/mezuro/test/functional/profile/mezuro_plugin_repository_controller_test.rb +++ b/plugins/mezuro/test/functional/profile/mezuro_plugin_repository_controller_test.rb @@ -31,12 +31,11 @@ class MezuroPluginRepositoryControllerTest < ActionController::TestCase get :new, :profile => @profile.identifier, :id => @content.id - assert_equal @content.id, assigns(:project_content_id) - assert_equal @content.name, assigns(:project_name) + assert_equal @content.id, assigns(:project_content).id assert_equal @repository_types, assigns(:repository_types) - assert_equal @content.profile.identifier, assigns(:data_profile) assert_equal @all_configurations.first.name, assigns(:configuration_select).first.first assert_equal @all_configurations.first.id, assigns(:configuration_select).first.last + assert_response :success end should 'create a repository' do @@ -58,20 +57,18 @@ class MezuroPluginRepositoryControllerTest < ActionController::TestCase end should 'set variables to edit a repository' do - articles = mock Kalibro::Repository.expects(:repository_types).returns(@repository_types) Kalibro::Configuration.expects(:all).returns(@all_configurations) Kalibro::Repository.expects(:repositories_of).with(@content.project_id).returns([@repository]) get :edit, :profile => @profile.identifier, :id => @content.id, :repository_id => @repository.id - assert_equal @content.id, assigns(:project_content_id) - assert_equal @content.name, assigns(:project_name) + assert_equal @content.id, assigns(:project_content).id assert_equal @repository_types, assigns(:repository_types) - assert_equal @content.profile.identifier, assigns(:data_profile) assert_equal @all_configurations.first.name, assigns(:configuration_select).first.first assert_equal @all_configurations.first.id, assigns(:configuration_select).first.last assert_equal @repository, assigns(:repository) + assert_response :success end should 'update a repository' do @@ -98,11 +95,9 @@ class MezuroPluginRepositoryControllerTest < ActionController::TestCase get :show, :profile => @profile.identifier, :id => @content.id, :repository_id => @repository.id - assert_equal @content.name, assigns(:project_name) + assert_equal @content.id, assigns(:project_content).id assert_equal @repository, assigns(:repository) assert_equal @configuration.name, assigns(:configuration_name) - assert_equal @content.profile.identifier, assigns(:data_profile) - assert_equal @content.id, assigns(:data_content) assert_response :success end diff --git a/plugins/mezuro/views/mezuro_plugin_metric_configuration/choose_metric.html.erb b/plugins/mezuro/views/mezuro_plugin_metric_configuration/choose_metric.html.erb index 2a11812..2075e60 100644 --- a/plugins/mezuro/views/mezuro_plugin_metric_configuration/choose_metric.html.erb +++ b/plugins/mezuro/views/mezuro_plugin_metric_configuration/choose_metric.html.erb @@ -1,4 +1,4 @@ -
- <%= f.submit "Add" %> -
+<%= f.submit "Add" %>
<% end %> diff --git a/plugins/mezuro/views/mezuro_plugin_repository/new.html.erb b/plugins/mezuro/views/mezuro_plugin_repository/new.html.erb index 35217e8..df9f65b 100644 --- a/plugins/mezuro/views/mezuro_plugin_repository/new.html.erb +++ b/plugins/mezuro/views/mezuro_plugin_repository/new.html.erb @@ -1,16 +1,11 @@ -- <%= f.submit "Add" %> -
+<%= f.submit "Add" %>
<% end %> diff --git a/plugins/mezuro/views/mezuro_plugin_repository/show.html.erb b/plugins/mezuro/views/mezuro_plugin_repository/show.html.erb index d9cb60a..8d8a72c 100644 --- a/plugins/mezuro/views/mezuro_plugin_repository/show.html.erb +++ b/plugins/mezuro/views/mezuro_plugin_repository/show.html.erb @@ -1,5 +1,5 @@ -