This commit is contained in:
Shlok Srivastava 2017-06-06 15:44:46 +00:00 committed by GitHub
commit cba845e99d
14 changed files with 144 additions and 3 deletions

View file

@ -0,0 +1,13 @@
FactoryGirl.define do
factory :organization do
name { Faker::Company.name }
description { Faker::Lorem.paragraph }
# after(:create) do |organization|
# File.open("spec/support/logos/#{1 + rand(13)}.png") do |file|
# organization.picture = file
# end
# organization.save!
# end
end
end

View file

@ -0,0 +1,19 @@
require 'spec_helper'
describe Organization do
let(:organization) { create(:organization) }
describe 'validation' do
it 'has a valid factory' do
expect(build(:organization)).to be_valid
end
it 'is not valid without a name' do
should validate_presence_of(:name)
end
end
describe 'associations' do
it { should have_many(:conferences).dependent(:destroy) }
end
end