Renamte 'tracker' to 'type'.

pull/6827/head
Christian Rijke 11 years ago
parent 5bf36685f1
commit 9968db24b3
  1. 2
      app/controllers/costlog_controller.rb
  2. 4
      features/step_definitions/cost_steps.rb
  3. 18
      spec/controllers/costlog_controller_spec.rb
  4. 8
      spec/models/cost_entry_spec.rb
  5. 6
      spec/models/issue_spec.rb
  6. 8
      spec/models/time_entry_spec.rb
  7. 4
      spec/models/variable_cost_object_spec.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)

@ -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 |

@ -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

@ -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) }

@ -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) }

@ -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) }

@ -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

Loading…
Cancel
Save