aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenare Degan <henare.degan@gmail.com>2013-01-23 12:21:38 +1100
committerHenare Degan <henare.degan@gmail.com>2013-01-23 12:21:38 +1100
commit0a19af1e65cd48d170cf853169e4220542db15e4 (patch)
treefd1aec2ec5174225bf8074d27ca243dcac2528e7
parentb60b459a1bfea6d9c60e302eaeaa403020459cc1 (diff)
Fix deprecation warnings
* Errors#on have been deprecated * Errors#[] now always returns an Array
-rw-r--r--spec/models/censor_rule_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/models/censor_rule_spec.rb b/spec/models/censor_rule_spec.rb
index d216ba91c..3782cc630 100644
--- a/spec/models/censor_rule_spec.rb
+++ b/spec/models/censor_rule_spec.rb
@@ -76,7 +76,7 @@ describe 'when validating rules' do
it 'should be invalid without text' do
censor_rule = CensorRule.new
censor_rule.valid?.should == false
- censor_rule.errors.on(:text).should == "can't be blank"
+ censor_rule.errors[:text].should == ["can't be blank"]
end
describe 'when validating a regexp rule' do
@@ -96,7 +96,7 @@ describe 'when validating rules' do
it 'should add an error message to the text field with the regexp error message' do
Regexp.stub!(:new).and_raise(RegexpError.new("very bad regexp"))
@censor_rule.valid?.should == false
- @censor_rule.errors.on(:text).should == "very bad regexp"
+ @censor_rule.errors[:text].should == ["very bad regexp"]
end
end
@@ -106,7 +106,7 @@ describe 'when validating rules' do
it 'should not add any error message to the text field' do
Regexp.stub!(:new)
@censor_rule.valid?
- @censor_rule.errors.on(:text).should == nil
+ @censor_rule.errors[:text].should == []
end
end