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/factory_girl/declaration/implicit_spec.rb

27 lines
678 B
Ruby
Raw Normal View History

require 'spec_helper'
describe FactoryGirl::Declaration::Implicit do
let(:name) { :author }
let(:proxy) { stub("proxy") }
let(:declaration) { FactoryGirl::Declaration::Implicit.new(name) }
subject { declaration.to_attributes.first }
context "with a known factory" do
before do
2011-08-12 22:06:10 -04:00
FactoryGirl.factories.stubs(:registered? => true)
end
it { should be_association }
its(:factory) { should == name }
end
context "with a known sequence" do
before do
FactoryGirl.sequences.stubs(:registered? => true)
end
it { should_not be_association }
it { should be_a(FactoryGirl::Attribute::Sequence) }
end
end