Sha256: 7da751e93c009aa76ebcbbefbb6453b3a115e6ad146ed21804cf77acb75d6618

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

module Tim
  describe BaseImage do
    describe "Model relationships" do
      it 'should have many image versions' do
        base_image = BaseImage.new
        2.times do
          base_image.image_versions << ImageVersion.new
        end
        base_image.save!
        BaseImage.find(base_image).image_versions.size.should == 2
      end

      it "should have one template" do
        base_image = BaseImage.new
        base_image.template = FactoryGirl.build(:template)
        base_image.save!
        BaseImage.find(base_image).template.should == base_image.template
      end
    end

    describe "Dummy model relationships" do
      it "should have one pool family" do
        base_image = BaseImage.new
        base_image.pool_family = PoolFamily.new
        base_image.save!
        BaseImage.find(base_image).pool_family.should == base_image.pool_family
      end

      it "should have one user" do
        base_image = BaseImage.new
        base_image.user = User.new
        base_image.save!
        BaseImage.find(base_image).user.should == base_image.user
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tim-0.1.2 spec/models/base_image_spec.rb
tim-0.1.1 spec/models/base_image_spec.rb
tim-0.0.1 spec/models/base_image_spec.rb