Sha256: 2c41e20a0e02a7b04f6a173c6740cb766380689d86003dee85704165a24f69d7

Contents?: true

Size: 1.6 KB

Versions: 3

Compression:

Stored size: 1.6 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe 'Formtastic::Util' do

  describe '.deprecated_version_of_rails?' do
    
    subject { Formtastic::Util.deprecated_version_of_rails? }
    
    context '3.0.0' do
      before { allow(Formtastic::Util).to receive(:rails_version) { Gem::Version.new("3.0.0") } }
      it 'should be true' do
        expect(subject).to be_true
      end
    end

    context '3.1.0' do
      before { allow(Formtastic::Util).to receive(:rails_version) { Gem::Version.new("3.1.0") } }
      it 'should be true' do
        expect(subject).to be_true
      end
    end

    context '3.2.12' do
      before { allow(Formtastic::Util).to receive(:rails_version) { Gem::Version.new("3.2.12") } }
      it 'should be true' do
        expect(subject).to be_true
      end
    end

    context '3.2.13' do
      before { allow(Formtastic::Util).to receive(:rails_version) { Gem::Version.new("3.2.13") } }
      it 'should be true' do
        expect(subject).to be_false
      end
    end

    context '3.2.14' do
      before { allow(Formtastic::Util).to receive(:rails_version) { Gem::Version.new("3.2.14") } }
      it 'should be true' do
        expect(subject).to be_false
      end
    end

    context '3.3.0' do
      before { allow(Formtastic::Util).to receive(:rails_version) { Gem::Version.new("3.3.0") } }
      it 'should be true' do
        expect(subject).to be_false
      end
    end

    context '4.0.0' do
      before { allow(Formtastic::Util).to receive(:rails_version) { Gem::Version.new("4.0.0") } }
      it 'should be true' do
        expect(subject).to be_false
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
formtastic-2.3.1 spec/util_spec.rb
formtastic-2.3.0 spec/util_spec.rb
formtastic-2.3.0.rc4 spec/util_spec.rb