1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/spec/acceptance/definition_spec.rb

22 lines
389 B
Ruby
Raw Normal View History

require 'spec_helper'
describe "an instance generated by a factory with a custom class name" do
before do
2012-03-09 17:20:38 -05:00
define_model("User", admin: :boolean)
FactoryGirl.define do
factory :user
2012-03-09 17:20:38 -05:00
factory :admin, class: User do
admin { true }
end
end
end
subject { FactoryGirl.create(:admin) }
2013-01-18 13:27:57 -05:00
it { should be_kind_of(User) }
it { should be_admin }
end