Fixed format of the date request to Rate.amount_for. #1924
This commit is contained in:
@@ -16,10 +16,10 @@ class FixedDeliverable < Deliverable
|
||||
|
||||
# Get all timelogs assigned
|
||||
time_logs = self.issues.collect(&:time_entries).flatten
|
||||
|
||||
|
||||
# Find each Member for their rate
|
||||
time_logs.each do |time_log|
|
||||
rate = Rate.amount_for(time_log.user, time_log.project, time_log.spent_on)
|
||||
rate = Rate.amount_for(time_log.user, time_log.project, time_log.spent_on.to_s)
|
||||
total += (rate * time_log.hours) unless rate.nil?
|
||||
end
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ class HourlyDeliverable < Deliverable
|
||||
|
||||
# Get all timelogs assigned
|
||||
time_logs = self.issues.collect(&:time_entries).flatten
|
||||
|
||||
|
||||
# Find each Member for their rate
|
||||
time_logs.each do |time_log|
|
||||
rate = Rate.amount_for(time_log.user, time_log.project, time_log.spent_on)
|
||||
rate = Rate.amount_for(time_log.user, time_log.project, time_log.spent_on.to_s)
|
||||
total += (rate * time_log.hours) unless rate.nil?
|
||||
end
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ describe FixedDeliverable, '.spent' do
|
||||
@issue_1_time_entry = mock_model(TimeEntry, :issue_id => @issue1.id, :user => @user, :project => @project, :hours => 1.0, :spent_on => Date.today)
|
||||
@issue1.stub!(:time_entries).and_return([@issue_1_time_entry])
|
||||
|
||||
Rate.should_receive(:amount_for).with(@user, @project, @issue_1_time_entry.spent_on).and_return(60.0)
|
||||
Rate.should_receive(:amount_for).with(@user, @project, @issue_1_time_entry.spent_on.to_s).and_return(60.0)
|
||||
|
||||
@deliverable = FixedDeliverable.new({ :subject => 'test' })
|
||||
@issues = [@issue1]
|
||||
|
||||
@@ -16,7 +16,7 @@ describe HourlyDeliverable, '.spent' do
|
||||
@issue_1_time_entry = mock_model(TimeEntry, :issue_id => @issue1.id, :user => @user, :project => @project, :hours => 1.0, :spent_on => Date.today)
|
||||
@issue1.stub!(:time_entries).and_return([@issue_1_time_entry])
|
||||
|
||||
Rate.should_receive(:amount_for).with(@user, @project, @issue_1_time_entry.spent_on).and_return(60.0)
|
||||
Rate.should_receive(:amount_for).with(@user, @project, @issue_1_time_entry.spent_on.to_s).and_return(60.0)
|
||||
|
||||
@deliverable = HourlyDeliverable.new({ :subject => 'test' })
|
||||
@issues = [@issue1]
|
||||
|
||||
Reference in New Issue
Block a user