Sha256: d0c20eddb71a07c1aaed8ac37faa06326a05765cc1570b98ca5b08b4a6604c18

Contents?: true

Size: 768 Bytes

Versions: 15

Compression:

Stored size: 768 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', 'spec_helper')

describe DelegateBelongsTo, 'with a mix of the default delegations and a specified delegation' do

  before :all do
    @fields = Contact.column_names - UserMixed.default_rejected_delegate_columns + [:fullname]
    UserMixed.delegate_belongs_to :contact, :defaults, :fullname
  end

  before :each do
    @user = UserMixed.new      
  end

  it 'should declare the association' do
    UserMixed.reflect_on_association(:contact).should_not be_nil
  end

  it 'creates reader methods for columns' do
    @fields.each do |col|
      @user.should respond_to(col)
    end
  end

  it 'creates writer methods for columns' do
    @fields.each do |col|
      @user.should respond_to("#{col}=")
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spree-0.11.4 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.11.3 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.11.2 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.11.1 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.11.0 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.10.2 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.10.1 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.10.0 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.10.0.beta vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-enriquez-0.9.4 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.9.4 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.9.3 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.9.2 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.9.1 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb
spree-0.9.0 vendor/plugins/delegate_belongs_to/spec/model/with_mixed_spec.rb