mirror of
https://github.com/nov/fb_graph2
synced 2023-03-27 23:22:15 -04:00
node subclass spec
This commit is contained in:
parent
0c607111de
commit
4c682fd6bc
4 changed files with 30 additions and 5 deletions
|
@ -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?
|
||||
|
|
23
spec/fb_graph2/node_subclass_spec.rb
Normal file
23
spec/fb_graph2/node_subclass_spec.rb
Normal file
|
@ -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
|
5
spec/fb_graph2/page_spec.rb
Normal file
5
spec/fb_graph2/page_spec.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe FbGraph2::Page do
|
||||
it :TODO
|
||||
end
|
|
@ -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
|
Loading…
Reference in a new issue