diff --git a/app/controllers/costlog_controller.rb b/app/controllers/costlog_controller.rb index 75613fb5a6..faa87b4880 100644 --- a/app/controllers/costlog_controller.rb +++ b/app/controllers/costlog_controller.rb @@ -49,7 +49,7 @@ class CostlogController < ApplicationController respond_to do |format| format.html { - @entries = CostEntry.includes(:project, :cost_type, :user, {:work_package => :tracker}) + @entries = CostEntry.includes(:project, :cost_type, :user, {:work_package => :type}) .where(cond.conditions) .order(sort_clause) .page(page_param) diff --git a/features/step_definitions/cost_steps.rb b/features/step_definitions/cost_steps.rb index d0d7677a66..93b7ef049a 100755 --- a/features/step_definitions/cost_steps.rb +++ b/features/step_definitions/cost_steps.rb @@ -77,9 +77,9 @@ Given /^there is a standard cost control project named "([^\"]*)"$/ do |name| Given there is 1 project with the following: | Name | #{name} | | Identifier | #{name.gsub(' ', '_').downcase} | - And the project "#{name}" has the following trackers: + And the project "#{name}" has the following types: | name | - | tracker1 | + | type1 | And the project "#{name}" has 1 subproject And the project "#{name}" has 1 work_package with: | subject | #{name}work_package | diff --git a/spec/controllers/costlog_controller_spec.rb b/spec/controllers/costlog_controller_spec.rb index cb314cedc6..18baf0197b 100644 --- a/spec/controllers/costlog_controller_spec.rb +++ b/spec/controllers/costlog_controller_spec.rb @@ -2,10 +2,10 @@ require File.expand_path(File.dirname(__FILE__) + "/../spec_helper.rb") describe CostlogController do include Cost::PluginSpecHelper - let (:project) { FactoryGirl.create(:project_with_trackers) } + let (:project) { FactoryGirl.create(:project_with_types) } let (:work_package) { FactoryGirl.create(:work_package, :project => project, :author => user, - :tracker => project.trackers.first) } + :type => project.types.first) } let (:user) { FactoryGirl.create(:user) } let (:user2) { FactoryGirl.create(:user) } let (:controller) { FactoryGirl.build(:role, :permissions => [:log_costs, :edit_cost_entries]) } @@ -199,9 +199,9 @@ describe CostlogController do before do grant_current_user_permissions user, [:edit_cost_entries] - cost_entry.project = FactoryGirl.create(:project_with_trackers) + cost_entry.project = FactoryGirl.create(:project_with_types) cost_entry.work_package = FactoryGirl.create(:work_package, :project => cost_entry.project, - :tracker => cost_entry.project.trackers.first, + :type => cost_entry.project.types.first, :author => user) cost_entry.save! end @@ -411,9 +411,9 @@ describe CostlogController do describe "WHEN the user is allowed to create cost_entries WHEN the id of an work_package not included in the provided project is provided" do - let(:project2) { FactoryGirl.create(:project_with_trackers) } + let(:project2) { FactoryGirl.create(:project_with_types) } let(:work_package2) { FactoryGirl.create(:work_package, :project => project2, - :tracker => project2.trackers.first, + :type => project2.types.first, :author => user) } let(:expected_work_package) { work_package2 } @@ -522,7 +522,7 @@ describe CostlogController do spent_on" do let(:expected_work_package) { FactoryGirl.create(:work_package, :project => project, - :tracker => project.trackers.first, + :type => project.types.first, :author => user) } let(:expected_user) { FactoryGirl.create(:user) } let(:expected_spent_on) { cost_entry.spent_on + 4.days } @@ -588,9 +588,9 @@ describe CostlogController do WHEN updating the work_package WHEN the new work_package isn't an work_package of the current project" do - let(:project2) { FactoryGirl.create(:project_with_trackers) } + let(:project2) { FactoryGirl.create(:project_with_types) } let(:work_package2) { FactoryGirl.create(:work_package, :project => project2, - :tracker => project2.trackers.first) } + :type => project2.types.first) } let(:expected_work_package) { work_package2 } before do diff --git a/spec/models/cost_entry_spec.rb b/spec/models/cost_entry_spec.rb index 18875679dc..c0b684234e 100644 --- a/spec/models/cost_entry_spec.rb +++ b/spec/models/cost_entry_spec.rb @@ -3,13 +3,13 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe CostEntry do include Cost::PluginSpecHelper - let(:project) { FactoryGirl.create(:project_with_trackers) } - let(:project2) { FactoryGirl.create(:project_with_trackers) } + let(:project) { FactoryGirl.create(:project_with_types) } + let(:project2) { FactoryGirl.create(:project_with_types) } let(:work_package) { FactoryGirl.create(:work_package, :project => project, - :tracker => project.trackers.first, + :type => project.types.first, :author => user) } let(:work_package2) { FactoryGirl.create(:work_package, :project => project2, - :tracker => project2.trackers.first, + :type => project2.types.first, :author => user) } let(:user) { FactoryGirl.create(:user) } let(:user2) { FactoryGirl.create(:user) } diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index af3ca38566..b62565c87f 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -4,14 +4,14 @@ describe WorkPackage do let(:user) { FactoryGirl.create(:admin)} let(:role) { FactoryGirl.create(:role) } let(:project) do - project = FactoryGirl.create(:project_with_trackers) + project = FactoryGirl.create(:project_with_types) project.add_member!(user, role) project end - let(:project2) { FactoryGirl.create(:project_with_trackers) } + let(:project2) { FactoryGirl.create(:project_with_types) } let(:work_package) { FactoryGirl.create(:work_package, :project => project, - :tracker => project.trackers.first, + :type => project.types.first, :author => user) } let!(:cost_entry) { FactoryGirl.create(:cost_entry, work_package: work_package, project: project, units: 3, spent_on: Date.today, user: user, comments: "test entry") } let!(:cost_object) { FactoryGirl.create(:cost_object, project: project) } diff --git a/spec/models/time_entry_spec.rb b/spec/models/time_entry_spec.rb index 7ccadfec77..54fd2d890f 100644 --- a/spec/models/time_entry_spec.rb +++ b/spec/models/time_entry_spec.rb @@ -2,13 +2,13 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe TimeEntry do include Cost::PluginSpecHelper - let(:project) { FactoryGirl.create(:project_with_trackers, is_public: false) } - let(:project2) { FactoryGirl.create(:project_with_trackers, is_public: false) } + let(:project) { FactoryGirl.create(:project_with_types, is_public: false) } + let(:project2) { FactoryGirl.create(:project_with_types, is_public: false) } let(:work_package) { FactoryGirl.create(:work_package, :project => project, - :tracker => project.trackers.first, + :type => project.types.first, :author => user) } let(:work_package2) { FactoryGirl.create(:work_package, :project => project2, - :tracker => project2.trackers.first, + :type => project2.types.first, :author => user2) } let(:user) { FactoryGirl.create(:user) } let(:user2) { FactoryGirl.create(:user) } diff --git a/spec/models/variable_cost_object_spec.rb b/spec/models/variable_cost_object_spec.rb index f4564d93b9..de2c716345 100644 --- a/spec/models/variable_cost_object_spec.rb +++ b/spec/models/variable_cost_object_spec.rb @@ -2,8 +2,8 @@ require File.dirname(__FILE__) + '/../spec_helper' describe VariableCostObject do let(:cost_object) { FactoryGirl.build(:variable_cost_object) } - let(:tracker) { FactoryGirl.create(:tracker_feature) } - let(:project) { FactoryGirl.create(:project_with_trackers) } + let(:type) { FactoryGirl.create(:type_feature) } + let(:project) { FactoryGirl.create(:project_with_types) } let(:user) { FactoryGirl.create(:user) } describe 'recreate initial journal' do