Sha256: 219aaf766af28a660c0fb3a6a0340c6b7fb65d2ad2ee0448dbd8451c4c31bb22

Contents?: true

Size: 617 Bytes

Versions: 28

Compression:

Stored size: 617 Bytes

Contents

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

include ApiResource

describe "Local" do
  
  it "should not go to the server to fetch a resource definition" do
    ApiResource::Connection.any_instance.expects(:get).never
    class MyTestResource < ApiResource::Local
      scope :test, {:test => true}
    end
    mtr = MyTestResource.new
    # should still have scopes

    MyTestResource.expects(:clear_attributes).never
    MyTestResource.expects(:clear_related_objects).never

    MyTestResource.reload_resource_definition
    mtr.scopes.should_not be_blank
    
  end
  
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
api_resource-0.6.25 spec/lib/local_spec.rb
api_resource-0.6.24 spec/lib/local_spec.rb
api_resource-0.6.23 spec/lib/local_spec.rb
api_resource-0.6.22 spec/lib/local_spec.rb
api_resource-0.6.21 spec/lib/local_spec.rb
api_resource-0.6.20 spec/lib/local_spec.rb
api_resource-0.6.19 spec/lib/local_spec.rb
api_resource-0.6.18 spec/lib/local_spec.rb
api_resource-0.6.17 spec/lib/local_spec.rb
api_resource-0.6.16 spec/lib/local_spec.rb
api_resource-0.6.15 spec/lib/local_spec.rb
api_resource-0.6.14 spec/lib/local_spec.rb
api_resource-0.6.13 spec/lib/local_spec.rb
api_resource-0.6.12 spec/lib/local_spec.rb
api_resource-0.6.11 spec/lib/local_spec.rb
api_resource-0.6.9 spec/lib/local_spec.rb
api_resource-0.6.10 spec/lib/local_spec.rb
api_resource-0.6.8 spec/lib/local_spec.rb
api_resource-0.6.7 spec/lib/local_spec.rb
api_resource-0.6.6 spec/lib/local_spec.rb