Skip to content

Commit

Permalink
Add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
marshall-lee committed Aug 3, 2015
1 parent 079993f commit edb14f9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/grape_entity/entity_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,15 @@ class Parent < Person
expect(subject.represent({ name: 'bar' }, serializable: true)).to eq(email: nil, name: 'bar')
expect(child_class.represent({ name: 'bar' }, serializable: true)).to eq(email: nil, name: 'foo')
end

it 'supports class reopening' do
subject.expose :name
child_class = Class.new(subject)
subject.expose :email

expect(subject.represent({ name: 'bar', email: 'foo@bar' }, serializable: true)).to eq(email: 'foo@bar', name: 'bar')
expect(child_class.represent({ name: 'bar', email: 'foo@bar' }, serializable: true)).to eq(email: 'foo@bar', name: 'foo')
end
end

context 'register formatters' do
Expand Down

0 comments on commit edb14f9

Please sign in to comment.