Sha256: 7275d752fe5b0ac1563f6a759669e418e12e93028fcf535f85e1aee6b810d43d

Contents?: true

Size: 786 Bytes

Versions: 13

Compression:

Stored size: 786 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe DattsRight, ".remove_definition(key, value)" do
  before do
    reset_database
  end
  
  it "should remove a definition from the existing definition" do
    c = Category.create
    c.definition = {:robot => {:object_type => "string"}}
    c.save
    c.remove_definition(:robot)
    c.definition[:robot].should be_nil
  end

  it "should raise NotDefinedError if it doesn't exist" do
    lambda {Category.create.remove_definition(:robot)}.should raise_error(DattsRight::NotDefinedError, "robot is not defined")
  end

  it "should raise NoDefinitionError if it doesn't have definition => true" do
    lambda {Page.create.remove_definition(:fake)}.should raise_error(DattsRight::NoDefinitionError)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
datts_right-0.0.32 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.31 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.30 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.29 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.28 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.27 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.26 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.25 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.24 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.23 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.22 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.21 spec/datts_right/remove_definition_spec.rb
datts_right-0.0.20 spec/datts_right/remove_definition_spec.rb