Sha256: 204b30c0a40fd7b5412097a34f2ea1a77ed9191ccbbf9bc7f72a0784f8eabda4

Contents?: true

Size: 590 Bytes

Versions: 23

Compression:

Stored size: 590 Bytes

Contents

require 'spec_helper'

describe Locomotive::Translation do

  let(:translation) { build(:translation) }

  it 'has a valid factory' do
    expect(translation).to be_valid
  end

  # Validations ##

  %w{site key}.each do |field|
    it "validates presence of #{field}" do
      translation.send(:"#{field}=", nil)
      expect(translation).to_not be_valid
      expect(translation.errors[field.to_sym].first).to eq("can't be blank")
    end
  end

  it_should_behave_like 'model scoped by a site' do

    let(:model)     { translation }
    let(:attribute) { :content_version }

  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
locomotivecms-3.3.0 spec/models/locomotive/translation_spec.rb
locomotivecms-3.3.0.rc3 spec/models/locomotive/translation_spec.rb
locomotivecms-3.3.0.rc2 spec/models/locomotive/translation_spec.rb
locomotivecms-3.1.2 spec/models/locomotive/translation_spec.rb
locomotivecms-3.2.1 spec/models/locomotive/translation_spec.rb
locomotivecms-3.3.0.rc1 spec/models/locomotive/translation_spec.rb
locomotivecms-3.2.0 spec/models/locomotive/translation_spec.rb
locomotivecms-3.2.0.rc2 spec/models/locomotive/translation_spec.rb
locomotivecms-3.2.0.rc1 spec/models/locomotive/translation_spec.rb
locomotivecms-3.1.1 spec/models/locomotive/translation_spec.rb
locomotivecms-3.1.0 spec/models/locomotive/translation_spec.rb
locomotivecms-3.1.0.rc3 spec/models/locomotive/translation_spec.rb
locomotivecms-3.1.0.rc2 spec/models/locomotive/translation_spec.rb
locomotivecms-3.1.0.rc1 spec/models/locomotive/translation_spec.rb
locomotivecms-3.0.1 spec/models/locomotive/translation_spec.rb
locomotivecms-3.0.0 spec/models/locomotive/translation_spec.rb
locomotivecms-3.0.0.rc7 spec/models/locomotive/translation_spec.rb
locomotivecms-3.0.0.rc6 spec/models/locomotive/translation_spec.rb
locomotivecms-3.0.0.rc5 spec/models/locomotive/translation_spec.rb
locomotivecms-3.0.0.rc4 spec/models/locomotive/translation_spec.rb