Sha256: 637106d4ebbb60dd5d9d772430c74c08804b8e0fdeeb227ce9f337439148c55b

Contents?: true

Size: 1.66 KB

Versions: 5

Compression:

Stored size: 1.66 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 '4.0.0' do
      before { allow(Formtastic::Util).to receive(:rails_version) { "4.0.0" } }
      it 'should be true' do
        expect(subject).to be_truthy
      end
    end

    context '4.0.3' do
      before { allow(Formtastic::Util).to receive(:rails_version) { "4.0.3" } }
      it 'should be true' do
        expect(subject).to be_truthy
      end
    end

    context '4.0.4' do
      before { allow(Formtastic::Util).to receive(:rails_version) { "4.0.4" } }
      it 'should be false' do
        expect(subject).to be_truthy
      end
    end

    context '4.0.5' do
      before { allow(Formtastic::Util).to receive(:rails_version) { "4.0.5" } }
      it 'should be false' do
        expect(subject).to be_truthy
      end
    end

    context '4.1.0' do
      before { allow(Formtastic::Util).to receive(:rails_version) { "4.1.0" } }
      it 'should be false' do
        expect(subject).to be_falsey
      end
    end

    context '4.1.1' do
      before { allow(Formtastic::Util).to receive(:rails_version) { "4.1.1" } }
      it 'should be false' do
        expect(subject).to be_falsey
      end
    end

    context '4.2.0' do
      before { allow(Formtastic::Util).to receive(:rails_version) { "4.2.0" } }
      it 'should be false' do
        expect(subject).to be_falsey
      end
    end

    context '5.0.0' do
      before { allow(Formtastic::Util).to receive(:rails_version) { "5.0.0" } }
      it 'should be true' do
        expect(subject).to be_falsey
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
formtastic-3.1.5 spec/util_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/formtastic-3.1.4/spec/util_spec.rb
formtastic-3.1.4 spec/util_spec.rb
formtastic-3.1.3 spec/util_spec.rb
formtastic-3.1.2 spec/util_spec.rb