From b20093aa553e49827b162b7acec0fdfc5f200cd8 Mon Sep 17 00:00:00 2001 From: Vincent Samaco Date: Tue, 4 Feb 2014 13:41:21 -0800 Subject: [PATCH] Added spec for editable attributes --- spec/schema_generator_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/schema_generator_spec.rb b/spec/schema_generator_spec.rb index 7ed39e0..9fa2b70 100644 --- a/spec/schema_generator_spec.rb +++ b/spec/schema_generator_spec.rb @@ -30,11 +30,21 @@ Example.schema[:validations][:code].should have_key :presence Example.schema[:validations][:code].should have_key :numericality end + + it 'includes editable attributes' do + Example.schema[:editable_attributes].size.should == 2 + Example.schema[:editable_attributes].should include(:name, :code) + end + + it 'excludes non-editable attributes' do + Example.schema[:editable_attributes].should_not include(:created_at) + end end class Example < Deja::Node attribute :name, String attribute :code, String + attribute :created_at, Time, :editable => false validates :name, :presence => true validates :code, :presence => true