Skip to content

Instantly share code, notes, and snippets.

@camallen
Created May 28, 2014 16:16
Show Gist options
  • Save camallen/b7a804c0abe88eddf7cb to your computer and use it in GitHub Desktop.
Save camallen/b7a804c0abe88eddf7cb to your computer and use it in GitHub Desktop.
project example with has_many workflows
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