public
Description: Makes tests easy on the fingers and the eyes
Homepage: http://www.thoughtbot.com/projects/shoulda
Clone URL: git://github.com/thoughtbot/shoulda.git
Search Repo:
fixed bug in should_protect_attributes

git-svn-id: https://svn.thoughtbot.com/plugins/shoulda/trunk@448 
7bbfaf0e-4d1d-0410-9690-a8bb5f8ef2aa
tsaleh (author)
Sun Apr 13 14:21:18 -0700 2008
commit  c01d820babea4e222a60aaa60c16891f5bb7d45b
tree    54f7c16b36e13e37fd61818a691f61c43aa24335
parent  ec9ead07ce32abbbd8bd49791fd9f5cbc4434853
...
106
107
108
109
 
110
111
112
...
106
107
108
 
109
110
111
112
0
@@ -106,7 +106,7 @@ module ThoughtBot # :nodoc:
0
         attributes.each do |attribute|
0
           attribute = attribute.to_sym
0
           should "protect #{attribute} from mass updates" do
0
- protected_attributes = klass.protected_attributes
0
+ protected_attributes = klass.protected_attributes || []
0
             assert protected_attributes.include?(attribute.to_s),
0
                    "#{klass} is protecting #{protected_attributes.to_a.to_sentence}, but not #{attribute}."
0
           end

Comments

    No one has commented yet.