Sha256: f5d7791a07972cf66a34a04f64bca54096b08fdace4c6d73715b75aa10c91048

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

require 'spec_helper'
module Axel::Associations
  describe HasMany do
    let(:instance) { User.new id: 1 }
    let(:options) { {} }
    subject { User.send(:has_many_associations)[:personas] }

    before do
      subject.send :options=, options
    end

    its(:build_klass) { should be Persona }

    it "tries to get a user with options" do
      Persona.should_receive(:querier).and_return(Persona)
      Persona.should_receive(:without_default_path).and_return(Persona)
      Persona.should_receive(:at_path).with("/users/1/personas").and_return(Persona)
      Persona.should_receive(:request_options).with({}).and_return([])

      instance.personas
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axel-0.0.1 spec/lib/axel/associations/has_many_spec.rb