Created
January 27, 2016 02:41
-
-
Save beliar91/7ab8eb9120b2f5e09734 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
require 'rails_helper' | |
RSpec.describe Task, type: :model do | |
let(:task2) {FactoryGirl.create(:task2)} | |
let(:task) {FactoryGirl.create(:task)} | |
let(:task_not_valid) {FactoryGirl.create(:task_not_valid, status: "Not valid")} | |
it "Task with not valid status should not be saved" do | |
task_not_valid.save | |
expect(task_not_valid.errors).to eq("is not included in the list") | |
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