Sha256: 2ab1c4a8e58920dbfb727eadfc9ae5c3e6f9e9d5897859e09e26885dd5c928f8
Contents?: true
Size: 991 Bytes
Versions: 3
Compression:
Stored size: 991 Bytes
Contents
require 'spec_helper' describe "Simple Item1 rings" do class Item1 < ActiveRecord::Base include RingStrongParameters::Model ring 3, :write => [:name,:address] ring 3, :read => [:name,:address,:member_code] end it "can specify ring fields" do Item1.rings_fields.should == [ nil, nil, nil, {:write=>[:address, :name], :read=>[:address, :member_code, :name]} ] Item1.rings_abilities.should == [] end end describe "Item2 rings with abilities" do class Item2 < ActiveRecord::Base include RingStrongParameters::Model ring 2, [:write,:delete] ring 3, :write => [:name,:address] ring 3, :read => [:name,:address,:member_code] ring 4, :read end it "can specify ring fields" do Item2.rings_fields.should == [ nil, nil, nil, {:write=>[:address, :name], :read=>[:address, :member_code, :name]} ] Item2.rings_abilities.should == [ nil, nil, [:delete,:write], nil, [:read] ] end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
kojac-0.9.1 | spec/model_ring_spec.rb |
kojac-0.9.0.1 | spec/model_ring_spec.rb |
kojac-0.9.0 | spec/model_ring_spec.rb |