Use correct variable in validate_confirmation_of matcher description

This commit is contained in:
Melissa Xie 2013-03-19 14:42:12 -04:00 committed by Melissa Xie
parent 4b91ea3c16
commit 632b4cfa70
2 changed files with 7 additions and 1 deletions

View File

@ -24,7 +24,7 @@ module Shoulda # :nodoc:
end
def description
"require #{@base_attribute} to match #{@attribute}"
"require #{@confirmation} to match #{@attribute}"
end
def matches?(subject)

View File

@ -1,6 +1,12 @@
require 'spec_helper'
describe Shoulda::Matchers::ActiveModel::ValidateConfirmationOfMatcher do
context '#description' do
it 'states that the confirmation must match its base attribute' do
matcher.description.should == 'require attr_confirmation to match attr'
end
end
context 'a model with a confirmation validation' do
it 'accepts' do
validating_confirmation.should matcher