Sha256: 88dd2e517284f7f5090d5ce37cbcbf290ad632836d7237d3646b04f454478306

Contents?: true

Size: 646 Bytes

Versions: 2

Compression:

Stored size: 646 Bytes

Contents

require 'spec_helper'

module StrongAttributes
  describe Permissible do
    it "selects permitted attributes" do
      permissible = Object.new
      permissible.extend(Permissible)
      
      permissible.permit! :a, :b, :c
      permitted = permissible.select_permitted :a, :c, :z
      expect(permitted).to include(:a, :c)
      expect(permitted).to_not include(:b, :z)
    end

    it "permits all if permit_all!" do
      permissible = Object.new
      permissible.extend(Permissible)

      permissible.permit_all!
      permitted = permissible.select_permitted :a, :b, :c
      expect(permitted).to include(:a, :b, :c)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
strong_attributes-0.0.2 spec/strong_attributes/permissible_spec.rb
strong_attributes-0.0.1 spec/strong_attributes/permissible_spec.rb