Sha256: 2d80774d215c10a00068fc966008e243d0b1eacc9137a07eecfd62f89eaa5ebf

Contents?: true

Size: 698 Bytes

Versions: 1

Compression:

Stored size: 698 Bytes

Contents

require 'spec_helper'

describe Zertico::Accessor do
  let(:user) { User.new }

  describe '.initialize' do
    it 'should initialize the interface object on a instance variable' do
      UserAccessor.new(user).instance_variable_get('@user').should == user
    end
  end

  describe '.find' do
    before :each do
      User.stub(:find => user)
    end

    it 'should initialize the interface object on a instance variable' do
      UserAccessor.find(3).instance_variable_get('@user').should == user
    end
  end

  describe '#method_missing' do
    it 'should pass the method to the interface model if it responds to it' do
      UserAccessor.new(user).should respond_to(:name)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zertico-0.3.0 spec/zertico/accessor_spec.rb