diff --git a/lib/fb_graph2/attribute_assigner.rb b/lib/fb_graph2/attribute_assigner.rb index 862ab96..3d44cc5 100644 --- a/lib/fb_graph2/attribute_assigner.rb +++ b/lib/fb_graph2/attribute_assigner.rb @@ -17,7 +17,7 @@ module FbGraph2 def assign(attributes) self.raw_attributes = attributes - self.class.registered_attributes.each do |type, keys| + Array(self.class.registered_attributes).each do |type, keys| keys.each do |key| raw = attributes[key] if raw.present? diff --git a/spec/fb_graph2/node_subclass_spec.rb b/spec/fb_graph2/node_subclass_spec.rb new file mode 100644 index 0000000..15d651d --- /dev/null +++ b/spec/fb_graph2/node_subclass_spec.rb @@ -0,0 +1,23 @@ +require 'spec_helper' + +module FbGraph2 + class NodeSubClass < Node + end +end + +describe FbGraph2::NodeSubClass do + let(:klass) { FbGraph2::NodeSubClass } + let(:instance) { klass.new 'identifier' } + + context 'class' do + subject { klass } + it { should respond_to :register_attributes } + it { should respond_to :registered_attributes } + it { should respond_to :registered_attributes= } + end + + context 'instance' do + subject { instance } + it { should respond_to :assign } + end +end \ No newline at end of file diff --git a/spec/fb_graph2/page_spec.rb b/spec/fb_graph2/page_spec.rb new file mode 100644 index 0000000..6a50e87 --- /dev/null +++ b/spec/fb_graph2/page_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe FbGraph2::Page do + it :TODO +end \ No newline at end of file diff --git a/spec/fb_graph2/user_spec.rb b/spec/fb_graph2/user_spec.rb index a038805..d1965ba 100644 --- a/spec/fb_graph2/user_spec.rb +++ b/spec/fb_graph2/user_spec.rb @@ -1,8 +1,5 @@ require 'spec_helper' describe FbGraph2::User do - it do - p FbGraph2::User, FbGraph2::User.registered_attributes - p FbGraph2::Page, FbGraph2::Page.registered_attributes - end + it :TODO end \ No newline at end of file