spec/restspec/schema/dsl_spec.rb in restspec-0.0.2 vs spec/restspec/schema/dsl_spec.rb in restspec-0.0.3
- old
+ new
@@ -73,6 +73,22 @@
it 'is not allowed to run in validations' do
expect(attribute.can_be_checked?).to eq(false)
end
end
end
+
+ describe '#include_attributes' do
+ let(:main_dsl) { DSL.new }
+ let(:schema_dsl) { SingleSchemaDSL.new(:name, main_dsl.mixins) }
+
+ before do
+ main_dsl.mixin :test_mixin do
+ attribute :test_attribute, string
+ end
+ end
+
+ it 'includes the attributes to the schema' do
+ schema_dsl.include_attributes(:test_mixin)
+ expect(schema_dsl.schema.attributes).to have_key('test_attribute')
+ end
+ end
end