diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/lib/model_attribute_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/model_attribute_spec.rb b/spec/lib/model_attribute_spec.rb new file mode 100644 index 000000000..88d3997b6 --- /dev/null +++ b/spec/lib/model_attribute_spec.rb @@ -0,0 +1,16 @@ +RSpec.describe ModelAttribute do + describe ".define" do + it "adds a new instance of ModelAttribute to @@all" do + ModelAttribute.define(:route, :name, :string) + + expect(ModelAttribute.all.length).to eq(1) + + model_attr = ModelAttribute.all.first + + expect(model_attr).to be_an_instance_of(ModelAttribute) + expect(model_attr.klass).to eq(:route) + expect(model_attr.name).to eq(:name) + expect(model_attr.data_type).to eq(:string) + end + end +end |
