Sha256: b33174a0b2b25b79eff86cd7b911090666000431c0aebcaf71ab98cf600fe047
Contents?: true
Size: 831 Bytes
Versions: 23
Compression:
Stored size: 831 Bytes
Contents
shared_examples_for "a model with first-class properties" do describe "properties" do let(:instance) { FactoryGirl.build(instance_factory_name, properties: { key: "value" }) } context "when properties are on an instance from the database" do before do instance.save! end subject { instance.class.find(instance.id) } its(:key) { should eq("value") } end context "when properties were set on an in-memory instance" do context "trying to access an existing property" do subject { instance.key } it { should eq("value") } end context "trying to access an nonexistent property" do subject { instance.bad } it "blows up normally" do expect { subject }.to raise_error(NoMethodError) end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems