Sha256: 6e975dbe4ff052fa8c9a3c6ef1538c48970bf4854d5bdbfafce2569e0113110d

Contents?: true

Size: 688 Bytes

Versions: 12

Compression:

Stored size: 688 Bytes

Contents

require 'spec_helper'

describe Locomotive::Concerns::Page::Redirect do

  let(:page) { FactoryGirl.build(:page, redirect: true, redirect_url: 'http://www.locomotivecms.com') }

  describe 'redirect option enabled' do

    it 'is valid' do
      page.valid?
      expect(page.errors[:redirect_url]).to be_blank
    end

    it 'requires the presence of the redirect url' do
      page.redirect_url = ''
      page.valid?
      expect(page.errors[:redirect_url]).to eq(["can't be blank"])
    end

    it 'requires the presence of the redirect type' do
      page.redirect_type = ''
      page.valid?
      expect(page.errors[:redirect_type]).to eq(["can't be blank"])
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
locomotivecms-3.0.0 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.rc7 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.rc6 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.rc5 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.rc4 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.rc3 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.rc2 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.rc1 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.pre.beta.1 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.pre.alpha.3 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.pre.alpha.2 spec/models/locomotive/concerns/page/redirect_spec.rb
locomotivecms-3.0.0.pre.alpha spec/models/locomotive/concerns/page/redirect_spec.rb