Created
January 28, 2016 11:30
-
-
Save beliar91/b930bfbd6aa29f94d3f9 to your computer and use it in GitHub Desktop.
spec/models/task.rb
This file contains 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
require 'rails_helper' | |
RSpec.describe Task, type: :model do | |
let(:task) {FactoryGirl.create(:task)} | |
let(:task_created_1) {FactoryGirl.create(:task_created_1)} | |
let(:task_created_2) {FactoryGirl.create(:task_created_2)} | |
let(:task_in_progress_1) {FactoryGirl.create(:task_in_progress_1)} | |
let(:task_in_progress_2) {FactoryGirl.create(:task_in_progress_2)} | |
it "Counting average execution time should return proper results" do | |
expect(task_created_2.count_average_execution_time).to eq(40) | |
expect(task_in_progress_1.count_average_execution_time).to eq(45) | |
end | |
it "A valid Task should be saved" do | |
task.save | |
expect(task.save).to eq(true) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment