Sha256: 372c31f91ce69c5442a30cca9c7b92f3727e8aa5c87483ca68e527a58910e835

Contents?: true

Size: 846 Bytes

Versions: 14

Compression:

Stored size: 846 Bytes

Contents

# Responsability
  # Test whether rails version > 4
  # includes attr_accessible if < 4
require 'minitest_helper'
require 'impressionist/rails_toggle'

module Impressionist
  describe RailsToggle do

    before {
      @toggle = RailsToggle.new
    }

    describe "Rails 4" do

      # see your_minitest_path/lib/minitest/mock.rb
      it "must not include attr_accessible" do
        @toggle.stub :supported_by_rails?, false do
          refute @toggle.should_include?
        end
      end

    end

    describe "Strong Parameters" do

      # see your_minitest_path/lib/minitest/mock.rb
      it "must not include attr_accessible" do
        @toggle.stub :supported_by_rails?, true do
          @toggle.stub :using_strong_parameters?, true do
            refute @toggle.should_include?
          end
        end
      end

    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
impressionist-2.0.0 tests/spec/rails_toggle_spec.rb
impressionist-1.6.1 tests/spec/rails_toggle_spec.rb
impressionist-1.6.0 tests/spec/rails_toggle_spec.rb
impressionist-1.5.2 tests/spec/rails_toggle_spec.rb
impressionist2-1.5.5 tests/spec/rails_toggle_spec.rb
impressionist2-1.5.4 tests/spec/rails_toggle_spec.rb
impressionist2-1.5.3 tests/spec/rails_toggle_spec.rb
impressionist2-1.5.1 tests/spec/rails_toggle_spec.rb
impressionist-1.5.1 tests/spec/rails_toggle_spec.rb
impressionist-1.4.13 tests/spec/rails_toggle_spec.rb
impressionist-1.4.12 tests/spec/rails_toggle_spec.rb
impressionist-1.4.11 tests/spec/rails_toggle_spec.rb
impressionist-1.4.10 tests/spec/rails_toggle_spec.rb
impressionist-1.4.9 tests/spec/rails_toggle_spec.rb