Sha256: b4a013dea763f62d63b5588cba0fd00aea9dc2f499c7e0fd586717bb74d0e646
Contents?: true
Size: 704 Bytes
Versions: 16
Compression:
Stored size: 704 Bytes
Contents
require "spec_helper" describe FactoryGirl::Decorator::DisallowsDuplicatesRegistry do let(:registry) { stub("registry", name: 'Great thing', register: true) } subject { described_class.new(registry) } it "delegates #register to the registry when not registered" do registry.stubs(registered?: false) subject.register(:awesome, {}) expect(registry).to have_received(:register).with(:awesome, {}) end it "raises when attempting to #register a previously registered strategy" do registry.stubs(registered?: true) expect { subject.register(:same_name, {}) }. to raise_error(FactoryGirl::DuplicateDefinitionError, "Great thing already registered: same_name") end end
Version data entries
16 entries across 13 versions & 5 rubygems