From 11acc99272a7bac44a165a52bd628b8112c70250 Mon Sep 17 00:00:00 2001 From: Nils Kenneweg Date: Thu, 24 Oct 2013 17:20:59 +0200 Subject: [PATCH 1/6] remove pe_status from enumerations. --- app/models/planning_element_status.rb | 8 +------- config/locales/de.yml | 1 - config/locales/en.yml | 1 - 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/models/planning_element_status.rb b/app/models/planning_element_status.rb index db8b92eba5..9913a652f0 100644 --- a/app/models/planning_element_status.rb +++ b/app/models/planning_element_status.rb @@ -26,18 +26,12 @@ # See doc/COPYRIGHT.rdoc for more details. #++ -class PlanningElementStatus < Enumeration +class PlanningElementStatus < ActiveRecord::Base unloadable has_many :planning_elements, :class_name => "PlanningElement", :foreign_key => 'planning_element_status_id' - OptionName = :enumeration_planning_element_statuses - - def option_name - OptionName - end - def objects_count planning_elements.count end diff --git a/config/locales/de.yml b/config/locales/de.yml index 987b8f2a36..db851eda4d 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -481,7 +481,6 @@ de: enumeration_activities: "Aktivitäten (Zeiterfassung)" enumeration_work_package_priorities: "Arbeitspaket-Prioritäten" - enumeration_planning_element_statuses: "Planungselement-Status" enumeration_reported_project_statuses: "Gemeldeter Projekt-Status" enumeration_system_activity: "System-Aktivität" diff --git a/config/locales/en.yml b/config/locales/en.yml index 07d863d5ca..a8c4b39ae2 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -478,7 +478,6 @@ en: enumeration_activities: "Activities (time tracking)" enumeration_work_package_priorities: "Work package priorities" enumeration_system_activity: "System Activity" - enumeration_planning_element_statuses: "Planning element status" enumeration_reported_project_statuses: "Reported project status" error_can_not_archive_project: "This project cannot be archived" From 9a108e8222aa9d5ae9242c18ffcd00ac650f1d3f Mon Sep 17 00:00:00 2001 From: Nils Kenneweg Date: Thu, 24 Oct 2013 18:02:15 +0200 Subject: [PATCH 2/6] remove pe_status. --- .../planning_element_statuses_controller.rb | 57 -------- .../planning_element_statuses_controller.rb | 50 ------- app/models/enumeration.rb | 2 +- app/models/planning_element_status.rb | 42 ------ config/routes.rb | 2 - ...anning_element_statuses_controller_spec.rb | 122 ------------------ .../planning_element_status_factory.rb | 35 ----- 7 files changed, 1 insertion(+), 309 deletions(-) delete mode 100644 app/controllers/api/v2/planning_element_statuses_controller.rb delete mode 100644 app/controllers/planning_element_statuses_controller.rb delete mode 100644 app/models/planning_element_status.rb delete mode 100644 spec/controllers/api/v2/planning_element_statuses_controller_spec.rb delete mode 100644 spec/factories/planning_element_status_factory.rb diff --git a/app/controllers/api/v2/planning_element_statuses_controller.rb b/app/controllers/api/v2/planning_element_statuses_controller.rb deleted file mode 100644 index 3b86f7bff3..0000000000 --- a/app/controllers/api/v2/planning_element_statuses_controller.rb +++ /dev/null @@ -1,57 +0,0 @@ -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -module Api - module V2 - - class PlanningElementStatusesController < PlanningElementStatusesController - unloadable - helper :timelines - - include ::Api::V2::ApiController - - accept_key_auth :index, :show - - def index - @planning_element_statuses = PlanningElementStatus.active - respond_to do |format| - format.api - end - end - - def show - @planning_element_status = PlanningElementStatus.active.find(params[:id]) - respond_to do |format| - format.api - end - end - end - - end -end - diff --git a/app/controllers/planning_element_statuses_controller.rb b/app/controllers/planning_element_statuses_controller.rb deleted file mode 100644 index c0f972d69a..0000000000 --- a/app/controllers/planning_element_statuses_controller.rb +++ /dev/null @@ -1,50 +0,0 @@ -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -class PlanningElementStatusesController < ApplicationController - unloadable - helper :timelines - - before_filter :disable_api - - accept_key_auth :index, :show - - def index - @planning_element_statuses = PlanningElementStatus.active - respond_to do |format| - format.html { render_404 } - end - end - - def show - @planning_element_status = PlanningElementStatus.active.find(params[:id]) - respond_to do |format| - format.html { render_404 } - end - end -end diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb index 759c47268b..b0791575a3 100644 --- a/app/models/enumeration.rb +++ b/app/models/enumeration.rb @@ -177,7 +177,7 @@ end # Force load the subclasses in development mode ['time_entry_activity', 'issue_priority', - 'reported_project_status', 'planning_element_status'].each do |enum_subclass| + 'reported_project_status'].each do |enum_subclass| require_dependency enum_subclass end diff --git a/app/models/planning_element_status.rb b/app/models/planning_element_status.rb deleted file mode 100644 index 9913a652f0..0000000000 --- a/app/models/planning_element_status.rb +++ /dev/null @@ -1,42 +0,0 @@ -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -class PlanningElementStatus < ActiveRecord::Base - unloadable - - has_many :planning_elements, :class_name => "PlanningElement", - :foreign_key => 'planning_element_status_id' - - def objects_count - planning_elements.count - end - - def transfer_relations(to) - planning_elements.update_all(:planning_element_status_id => to.id) - end -end diff --git a/config/routes.rb b/config/routes.rb index 7fcd374758..b2b268c016 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -422,8 +422,6 @@ OpenProject::Application.routes.draw do end end - resources :planning_element_statuses, :controller => 'planning_element_statuses' - resources :project_types, :controller => 'project_types' do member do get :confirm_destroy diff --git a/spec/controllers/api/v2/planning_element_statuses_controller_spec.rb b/spec/controllers/api/v2/planning_element_statuses_controller_spec.rb deleted file mode 100644 index 5949748154..0000000000 --- a/spec/controllers/api/v2/planning_element_statuses_controller_spec.rb +++ /dev/null @@ -1,122 +0,0 @@ -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -require File.expand_path('../../../../spec_helper', __FILE__) - -describe Api::V2::PlanningElementStatusesController do - let(:current_user) { FactoryGirl.create(:admin) } - - before do - User.stub(:current).and_return current_user - end - - describe 'index.xml' do - def fetch - get 'index', :format => 'xml' - end - it_should_behave_like "a controller action with unrestricted access" - - describe 'with no planning element statuses available' do - it 'assigns an empty planning_element_statuses array' do - get 'index', :format => 'xml' - assigns(:planning_element_statuses).should == [] - end - - it 'renders the index builder template' do - get 'index', :format => 'xml' - response.should render_template('planning_element_statuses/index', :formats => ["api"]) - end - end - - describe 'with 3 planning element statuses available' do - before do - @created_planning_element_statuses = [ - FactoryGirl.create(:planning_element_status), - FactoryGirl.create(:planning_element_status), - FactoryGirl.create(:planning_element_status) - ] - end - - it 'assigns an array with all planning element statuses' do - get 'index', :format => 'xml' - assigns(:planning_element_statuses).should == @created_planning_element_statuses - end - - it 'renders the index template' do - get 'index', :format => 'xml' - response.should render_template('planning_element_statuses/index', :formats => ["api"]) - end - end - end - - describe 'show.xml' do - describe 'with unknown planning element status' do - if false # would like to write it this way - it 'returns status code 404' do - get 'show', :id => '1337', :format => 'xml' - - response.status.should == '404 Not Found' - end - - it 'returns an empty body' do - get 'show', :id => '1337', :format => 'xml' - - response.body.should be_empty - end - - else # but have to write it that way - it 'raises ActiveRecord::RecordNotFound errors' do - lambda do - get 'show', :id => '1337', :format => 'xml' - end.should raise_error(ActiveRecord::RecordNotFound) - end - end - end - - describe 'with an available planning element status' do - before do - @available_planning_element_status = FactoryGirl.create(:planning_element_status, :id => '1337') - end - - def fetch - get 'show', :id => '1337', :format => 'xml' - end - it_should_behave_like "a controller action with unrestricted access" - - it 'assigns the available planning element status' do - get 'show', :id => '1337', :format => 'xml' - assigns(:planning_element_status).should == @available_planning_element_status - end - - it 'renders the show template' do - get 'show', :id => '1337', :format => 'xml' - response.should render_template('planning_element_statuses/show', :formats => ["api"]) - end - end - end -end diff --git a/spec/factories/planning_element_status_factory.rb b/spec/factories/planning_element_status_factory.rb deleted file mode 100644 index d09d63c934..0000000000 --- a/spec/factories/planning_element_status_factory.rb +++ /dev/null @@ -1,35 +0,0 @@ -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -FactoryGirl.define do - factory(:planning_element_status, :class => PlanningElementStatus) do - sequence(:name) { |n| "Planning Element Status No. #{n}" } - - sequence(:position) { |n| n } - end -end From 8d1dc2113b477c34a1b8ec6bc5c629a21a6fee43 Mon Sep 17 00:00:00 2001 From: Nils Kenneweg Date: Thu, 24 Oct 2013 18:18:03 +0200 Subject: [PATCH 3/6] remove unneeded tests. --- .../_planning_element_status_api_rsb_spec.rb | 70 ------------ .../index_api_rsb_spec.rb | 104 ------------------ .../show_api_rsb_spec.rb | 74 ------------- 3 files changed, 248 deletions(-) delete mode 100644 spec/views/api/v2/planning_element_statuses/_planning_element_status_api_rsb_spec.rb delete mode 100644 spec/views/api/v2/planning_element_statuses/index_api_rsb_spec.rb delete mode 100644 spec/views/api/v2/planning_element_statuses/show_api_rsb_spec.rb diff --git a/spec/views/api/v2/planning_element_statuses/_planning_element_status_api_rsb_spec.rb b/spec/views/api/v2/planning_element_statuses/_planning_element_status_api_rsb_spec.rb deleted file mode 100644 index f6c19c094f..0000000000 --- a/spec/views/api/v2/planning_element_statuses/_planning_element_status_api_rsb_spec.rb +++ /dev/null @@ -1,70 +0,0 @@ -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -require File.expand_path('../../../../../spec_helper', __FILE__) - -describe 'api/v2/planning_element_statuses/_planning_element_status.api' do - before do - view.extend TimelinesHelper - end - - # added to pass in locals - def render - params[:format] = 'xml' - super(:partial => 'api/v2/planning_element_statuses/planning_element_status.api', :object => planning_element_status) - end - - describe 'with an assigned planning_element_status' do - let(:planning_element_status) { FactoryGirl.build(:planning_element_status, - :id => 1, - :name => 'Awesometastic Planning Element Status', - :position => 100) } - - it 'renders a planning_element_status node' do - render - response.should have_selector('planning_element_status', :count => 1) - end - - describe 'planning_element_status node' do - it 'contains an id element containing the planning element status id' do - render - response.should have_selector('planning_element_status id', :text => '1') - end - - it 'contains a name element containing the planning element status name' do - render - response.should have_selector('planning_element_status name', :text => 'Awesometastic Planning Element Status') - end - - it 'contains an position element containing the planning element status position' do - render - response.should have_selector('planning_element_status position', :text => '100') - end - end - end -end diff --git a/spec/views/api/v2/planning_element_statuses/index_api_rsb_spec.rb b/spec/views/api/v2/planning_element_statuses/index_api_rsb_spec.rb deleted file mode 100644 index 12f2b0d046..0000000000 --- a/spec/views/api/v2/planning_element_statuses/index_api_rsb_spec.rb +++ /dev/null @@ -1,104 +0,0 @@ -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -require File.expand_path('../../../../../spec_helper', __FILE__) - -describe 'api/v2/planning_element_statuses/index.api.rsb' do - before do - view.extend TimelinesHelper - end - - before do - params[:format] = 'xml' - end - - describe 'with no planning element statuses available' do - it 'renders an empty planning_element_statuses document' do - assign(:planning_element_statuses, []) - - render - - response.should have_selector('planning_element_statuses', :count => 1) - response.should have_selector('planning_element_statuses[type=array][size="0"]') do - without_tag 'planning_element_status' - end - end - end - - describe 'with 3 planning element statuses available' do - let(:planning_element_statuses) do - [ - FactoryGirl.build(:planning_element_status), - FactoryGirl.build(:planning_element_status), - FactoryGirl.build(:planning_element_status) - ] - end - - it 'renders a planning_element_statuses document with the size 3 of type array' do - assign(:planning_element_statuses, planning_element_statuses) - - render - - response.should have_selector('planning_element_statuses', :count => 1) - response.should have_selector('planning_element_statuses[type=array][size="3"]') - end - - it 'renders a planning_element_status for each assigned planning element' do - assign(:planning_element_statuses, planning_element_statuses) - - - render - - response.should have_selector('planning_element_statuses planning_element_status', :count => 3) - end - - it 'renders the _planning_element_status template for each assigned planning element status' do - assign(:planning_element_statuses, planning_element_statuses) - - view.should_receive(:render).exactly(3).times.with(hash_including(:partial => '/api/v2/planning_element_statuses/planning_element_status.api')).and_return('') - - # just to be able to call render despite the should_receive expectations above - view.should_receive(:render).once.with({:template=>"api/v2/planning_element_statuses/index", :handlers=>["rsb"], :formats=>["api"]}, {}).and_call_original - - render - end - - it 'passes the planning element statuses as local var to the partial' do - assign(:planning_element_statuses, planning_element_statuses) - - view.should_receive(:render).once.with(hash_including(:object => planning_element_statuses.first)).and_return('') - view.should_receive(:render).once.with(hash_including(:object => planning_element_statuses.second)).and_return('') - view.should_receive(:render).once.with(hash_including(:object => planning_element_statuses.third)).and_return('') - - # just to be able to call render despite the should_receive expectations above - view.should_receive(:render).once.with({:template=>"api/v2/planning_element_statuses/index", :handlers=>["rsb"], :formats=>["api"]}, {}).and_call_original - - render - end - end -end diff --git a/spec/views/api/v2/planning_element_statuses/show_api_rsb_spec.rb b/spec/views/api/v2/planning_element_statuses/show_api_rsb_spec.rb deleted file mode 100644 index c47b8ffbc4..0000000000 --- a/spec/views/api/v2/planning_element_statuses/show_api_rsb_spec.rb +++ /dev/null @@ -1,74 +0,0 @@ -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -require File.expand_path('../../../../../spec_helper', __FILE__) - -describe 'api/v2/planning_element_statuses/show.api.rsb' do - before do - view.extend TimelinesHelper - end - - before do - params[:format] = 'xml' - end - - describe 'with an assigned planning element status' do - let(:planning_element_status) { FactoryGirl.build(:planning_element_status) } - - before do - assign(:planning_element_status, planning_element_status) - end - - it 'renders a planning_element_status document' do - - render - - response.should have_selector('planning_element_status', :count => 1) - end - - it 'renders the _planning_element_status template once' do - - view.should_receive(:render).once.with(hash_including(:partial => '/api/v2/planning_element_statuses/planning_element_status.api')).and_return('') - - # just to render the speced template despite the should receive expectations above - view.should_receive(:render).once.with({:template=>"api/v2/planning_element_statuses/show", :handlers=>["rsb"], :formats=>["api"]}, {}).and_call_original - - render - end - - it 'passes the planning element status as local var to the partial' do - - view.should_receive(:render).once.with(hash_including(:object => planning_element_status)).and_return('') - - # just to render the speced template despite the should receive expectations above - view.should_receive(:render).once.with({:template=>"api/v2/planning_element_statuses/show", :handlers=>["rsb"], :formats=>["api"]}, {}).and_call_original - - render - end - end -end From 256883b5a647458ee711bc702a8ec9fc42363284 Mon Sep 17 00:00:00 2001 From: Nils Kenneweg Date: Thu, 24 Oct 2013 18:30:03 +0200 Subject: [PATCH 4/6] remove pe_status steps. --- .../planning_element_status_steps.rb | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 features/step_definitions/planning_element_status_steps.rb diff --git a/features/step_definitions/planning_element_status_steps.rb b/features/step_definitions/planning_element_status_steps.rb deleted file mode 100644 index 19d93fbe1e..0000000000 --- a/features/step_definitions/planning_element_status_steps.rb +++ /dev/null @@ -1,29 +0,0 @@ -#-- copyright -# OpenProject is a project management system. -# Copyright (C) 2012-2013 the OpenProject Foundation (OPF) -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License version 3. -# -# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: -# Copyright (C) 2006-2013 Jean-Philippe Lang -# Copyright (C) 2010-2013 the ChiliProject Team -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# See doc/COPYRIGHT.rdoc for more details. -#++ - -InstanceFinder.register(PlanningElementStatus, Proc.new { |name| PlanningElementStatus.find_by_name(name) }) From 8f80848e91e2781ed142b021f3f93035fc1c92f7 Mon Sep 17 00:00:00 2001 From: Nils Kenneweg Date: Fri, 25 Oct 2013 10:25:51 +0200 Subject: [PATCH 5/6] remove steps not needed any more. --- features/step_definitions/timelines_given_steps.rb | 8 -------- features/timelines/timeline_wiki_macro.feature | 3 --- 2 files changed, 11 deletions(-) diff --git a/features/step_definitions/timelines_given_steps.rb b/features/step_definitions/timelines_given_steps.rb index e969470b86..1b961a582e 100644 --- a/features/step_definitions/timelines_given_steps.rb +++ b/features/step_definitions/timelines_given_steps.rb @@ -47,14 +47,6 @@ Given /^I am working in the [tT]imeline "([^"]*)" of the project called "([^"]*) @timeline_name = timeline_name end -Given /^there are the following planning element statuses:$/ do |table| - table.map_headers! { |header| header.underscore.gsub(' ', '_') } - - table.hashes.each do |type_attributes| - FactoryGirl.create(:planning_element_status, type_attributes) - end -end - Given /^there are the following reported project statuses:$/ do |table| table.map_headers! { |header| header.underscore.gsub(' ', '_') } diff --git a/features/timelines/timeline_wiki_macro.feature b/features/timelines/timeline_wiki_macro.feature index fc75be73d9..c8c944be51 100644 --- a/features/timelines/timeline_wiki_macro.feature +++ b/features/timelines/timeline_wiki_macro.feature @@ -82,9 +82,6 @@ Feature: Timeline Wiki Macro And the user "manager" is a "loser" And the user "mrtimeline" is a "god" - And there are the following planning element statuses: - | Name | - | closed | And there are the following work packages: | Subject | Start date | Due date | description | status | responsible | | January | 2012-01-01 | 2012-01-31 | Avocado Grande | closed | manager | From 7d3d20dc17ab8df86557725639693539b89a2970 Mon Sep 17 00:00:00 2001 From: Nils Kenneweg Date: Fri, 25 Oct 2013 10:52:52 +0200 Subject: [PATCH 6/6] changelog. --- doc/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 5656f50dae..ed4c326edf 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -38,7 +38,8 @@ See doc/COPYRIGHT.rdoc for more details. * `#2026` 404 error when letters are entered in category Work Package * `#2371` Add support for IE10 to Timelines * `#2423` [Issue Tracker] Several Internal Errors when there is no default work package status -* `#2427` [Issue Tracker] Cannot delete work package priority +* `#2426` [Core] Enumerations for planning elements +* `#2427` [Issue Tracker] Cannot delete work package priority * `#2433` [Timelines] Empty timeline report not displayed initially * `#2448` Accelerate work package updates * `#2464` No initial attachment journal for messages