Sha256: 687649b03cf4491e3aa3435980c7cb5e65b3fce3628f11aa21bd16a4969fd882

Contents?: true

Size: 705 Bytes

Versions: 13

Compression:

Stored size: 705 Bytes

Contents

require 'spec_helper'

describe CustomFields::CustomFieldsFor do
  
  describe 'Saving' do
    
    before(:each) do
      @project = Project.new(:name => 'Locomotive')
      @project.person_custom_fields.build(:label => 'E-mail', :_alias => 'email', :kind => 'String')
      @project.person_custom_fields.build(:label => 'Age', :_alias => 'age', :kind => 'String')
    end
    
    context '@create' do
    
      it 'persists parent object' do
        lambda { @project.save }.should change(Project, :count).by(1)
      end
    
      it 'persists custom fields' do
        @project.save && @project.reload
        @project.person_custom_fields.count.should == 2
      end
    
    end
    
  end
  
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
custom_fields-0.0.0.1 spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.3.3 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.3.1 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2.9 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2.8 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2.7 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2.6 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2.5 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2.4 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2.3 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2.2 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2.1 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb
locomotive_cms-0.0.2 vendor/plugins/custom_fields/spec/integration/custom_fields_for_spec.rb