spec/presenter_spec.rb in faceted-1.0.7 vs spec/presenter_spec.rb in faceted-1.0.8

- old
+ new

@@ -57,9 +57,19 @@ musician = MyApi::Musician.new(:id => 1) musician.alive.should be_false musician.alive.should_not be_nil end + it 'excludes fields' do + musician = MyApi::Musician.new(:id => 1, :excludes => [:rating]) + musician.schema_fields.include?(:rating).should be_false + end + + it 'excludes relations' do + musician = MyApi::Musician.new(:id => 1, :excludes => [:birthplace]) + musician.schema_fields.include?(:birthplace).should be_false + end + end it 'overwrites values from its AR counterpart' do musician = MyApi::Musician.new(:id => 1, :rating => 'Great') musician.rating.should == 'Great'