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