Sha256: 09076b7e49b3c22eabeb3993b7912e98acb256d752abb5b75ecc1ee728b7fa16

Contents?: true

Size: 1.3 KB

Versions: 14

Compression:

Stored size: 1.3 KB

Contents

require File.dirname(__FILE__) + '/../test_helper.rb'

context "Configuration" do
  specify "should have an empty whitelist if only restful options are passed in" do
    config = Restful.cfg
    config.restful_options[:expansion] = :expanded
    config.whitelisted.should.empty
  end
  
  specify "should return fields without restful_options via whitelisted" do
    config = Restful.cfg([:one, :two])
    config.restful_options[:expansion] = :expanded
    config.whitelisted.should.not.include :restful_options
  end
  
  specify "should have 0 whitelisted fields if none were specified" do
  end
  
  specify "should know if it has restful_options" do
    config = Restful.cfg([:one, :two])
    config.restful_options[:expansion] = :expanded
    config.restful_options.should.not.empty
  end
  
  specify "should be able to handle nested whitelist attributes" do
    config = Restful.cfg(:one, :two => [:a, :b])
    config.nested(:two).whitelisted.should.== [:a,:b]
  end
  
  specify "should know which attributes are published" do
    config = Restful.cfg(:one, :two => [:a, :b])
    config.published?(:two).should.== true
    config.published?(:one).should.== true
  end
  
  specify "should know if it is nested" do
    config = Restful.cfg(:one, :restful_options => {:nested => true})
    config.nested?.should.== true
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
benjaminkrause-restful-0.2.8 test/rails/configuration_test.rb
purzelrakete-restful-0.2.10 test/rails/configuration_test.rb
purzelrakete-restful-0.2.11 test/rails/configuration_test.rb
purzelrakete-restful-0.2.12 test/rails/configuration_test.rb
purzelrakete-restful-0.2.13 test/rails/configuration_test.rb
purzelrakete-restful-0.2.14 test/rails/configuration_test.rb
purzelrakete-restful-0.2.15 test/rails/configuration_test.rb
purzelrakete-restful-0.2.16 test/rails/configuration_test.rb
purzelrakete-restful-0.2.17 test/rails/configuration_test.rb
purzelrakete-restful-0.2.18 test/rails/configuration_test.rb
purzelrakete-restful-0.2.6 test/rails/configuration_test.rb
purzelrakete-restful-0.2.7 test/rails/configuration_test.rb
purzelrakete-restful-0.2.8 test/rails/configuration_test.rb
purzelrakete-restful-0.2.9 test/rails/configuration_test.rb