Sha256: 59856a4466ee6fd2d219a566472417f75987d5b30bb16b30dd31794ec39f0064

Contents?: true

Size: 828 Bytes

Versions: 33

Compression:

Stored size: 828 Bytes

Contents

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

describe DattsRight, ".remove_dynamic_attribute(attr_key)" do
  before do
    reset_database
    @page = Page.create
  end

  it "should be aliased by remove_datt" do
    Page.instance_method(:remove_dynamic_attribute).should == Page.instance_method(:remove_datt)
  end

  it "should remove the attribute completely" do
    @page.add_dynamic_attribute(:rocks, "string")
    @page.remove_dynamic_attribute(:rocks)
    lambda { @page.rocks }.should raise_error(NoMethodError)
  end

  it "should not explode if the attribute being removed isn't there" do
    @page.add_dynamic_attribute(:rocks, "string")
    @page.remove_dynamic_attribute(:rocks)
    lambda {
      @page.remove_dynamic_attribute(:rocks)
    }.should_not raise_error(NoMethodError)
  end
end

Version data entries

33 entries across 20 versions & 1 rubygems

Version Path
datts_right-0.0.22 spec/datts_right/remove_dynamic_attribute_spec.rb
datts_right-0.0.22 spec/datts_right/add_dynamic_attribute_spec.rb
datts_right-0.0.21 spec/datts_right/add_dynamic_attribute_spec.rb
datts_right-0.0.21 spec/datts_right/remove_dynamic_attribute_spec.rb
datts_right-0.0.20 spec/datts_right/add_dynamic_attribute_spec.rb
datts_right-0.0.20 spec/datts_right/remove_dynamic_attribute_spec.rb
datts_right-0.0.19 spec/datts_right/remove_dynamic_attribute_spec.rb
datts_right-0.0.18 spec/datts_right/remove_dynamic_attribute_spec.rb
datts_right-0.0.17 spec/datts_right/remove_dynamic_attribute_spec.rb
datts_right-0.0.16 spec/datts_right/remove_dynamic_attribute_spec.rb
datts_right-0.0.15 spec/datts_right/remove_dynamic_attribute_spec.rb
datts_right-0.0.14 spec/datts_right/remove_dynamic_attribute_spec.rb
datts_right-0.0.13 spec/datts_right/remove_dynamic_attribute_spec.rb