Created
January 30, 2016 20:34
-
-
Save beliar91/d96bb4652d8f50726c74 to your computer and use it in GitHub Desktop.
spec/models/task_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "Counting average execution time should return proper results" do | |
task_1 = Task.create(name: "ABCD", status: "Created", completion_time:30) | |
task_2 = Task.create(name: "ABCDE", status: "Created", completion_time: 70) | |
sum_of_completion_time = task_1.completion_time + task_2.completion_time | |
number_of_tasks = Task.all.count | |
average_execution_time = sum_of_completion_time / number_of_tasks | |
expect(average_execution_time).to eq(task_2.count_average_execution_time) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment