Created
May 28, 2014 16:16
-
-
Save camallen/b7a804c0abe88eddf7cb to your computer and use it in GitHub Desktop.
project example with has_many workflows
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 'spec_helper' | |
describe Project, type: :model do | |
let(:project) { build(:project) } | |
it "should have a valid factory" do | |
expect(project).to be_valid | |
end | |
it "must have a user owner" do | |
project.owner = nil | |
expect(project).to_not be_valid | |
end | |
describe "#workflows" do | |
let(:workflow) { build(:workflow) } | |
it "should find the expected workflows " do | |
project.workflows << workflow | |
expect(project.workflows).to eq([workflow]) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment