spec/spec_helpers/examples/model.rb in protector-0.6.4 vs spec/spec_helpers/examples/model.rb in protector-0.7.0
- old
+ new
@@ -5,20 +5,20 @@
subject.should == '!'
entry.protector_subject?.should == false
scope { limit(5) }
- can :view
+ can :read
can :create
can :update
end
end
fields = Hash[*%w(id string number text dummy_id).map{|x| [x, nil]}.flatten]
meta = dummy.new.restrict!('!').protector_meta
- meta.access[:view].should == fields
+ meta.access[:read].should == fields
meta.access[:create].should == fields
meta.access[:update].should == fields
end
it "drops meta on restrict" do
@@ -62,10 +62,10 @@
#
describe "readability" do
it "hides fields" do
dummy.instance_eval do
protect do
- can :view, :string
+ can :read, :string
end
end
d = dummy.first.restrict!('!')
d.number.should == nil
\ No newline at end of file