Sha256: 0c2c0730a111b8ee154098364435fc27ce7d3f6bb5b404968c9e872abec7cb33

Contents?: true

Size: 690 Bytes

Versions: 15

Compression:

Stored size: 690 Bytes

Contents

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

describe DelegateBelongsTo, 'with no default delegations and one specified delegation' do

  before :all do
    @fields = [:fullname]
    UserNoDefault.delegate_belongs_to :contact, *@fields
  end

  before :each do
    @user = UserNoDefault.new      
  end

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

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

  it 'creates writer methods for fields' 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_no_defaults_spec.rb
spree-0.11.3 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.11.2 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.11.1 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.11.0 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.10.2 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.10.1 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.10.0 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.10.0.beta vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-enriquez-0.9.4 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.9.4 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.9.3 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.9.2 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.9.1 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb
spree-0.9.0 vendor/plugins/delegate_belongs_to/spec/model/with_no_defaults_spec.rb