Sha256: 4779762ea2ee9e0b28c33c1749f2d454257363f2dac8a260dd416c57ac99107a

Contents?: true

Size: 584 Bytes

Versions: 2

Compression:

Stored size: 584 Bytes

Contents

require 'spec_helper'

class MyExampleModel < Base
  include Concerns::Destroyable
  self.prefix = "/test/"
  self.element_name = "example"
end

describe Concerns::Destroyable, "Destroyable Concern" do

  before :each do
    stub_auth_request
    stub_api_get("/test/example", 'base.json')
    @model = MyExampleModel.first
  end

  it "should not be destroyed" do
    @model.destroyed?.should eq(false)
  end

  it "should be destroyable" do
    stub_api_delete("/test/example/1")
    @model = MyExampleModel.first
    @model.destroy
    @model.destroyed?.should eq(true)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spark_api-1.2.1 spec/unit/spark_api/models/concerns/destroyable_spec.rb
spark_api-1.2.0 spec/unit/spark_api/models/concerns/destroyable_spec.rb