spec/model_spec.rb in katapult-0.3.0 vs spec/model_spec.rb in katapult-0.4.0

- old
+ new

@@ -1,7 +1,6 @@ -require 'katapult/model' -require 'katapult/attribute' +require 'katapult/elements/model' describe Katapult::Model do subject { described_class.new('model') } @@ -10,9 +9,13 @@ subject.attr 'first_attr', type: :json subject.attr 'second_attr' subject.attr 'third_attr' expect(subject.label_attr.name).to eql('second_attr') + end + + it 'raises an error when someone needs/wants/expect a label attribute but there is none' do + expect{ subject.label_attr }.to raise_error Katapult::Model::MissingLabelAttributeError end end end