This commit is contained in:
ojab 2015-12-25 14:15:32 +00:00 committed by Elliot Winkler
parent 9822760355
commit 1dbf71bfe5
2 changed files with 10 additions and 2 deletions

View File

@ -603,7 +603,7 @@ pass, or do something else entirely.
def inspected_values_to_set
Shoulda::Matchers::Util.inspect_values(values_to_set).to_sentence(
two_words_connector: " or ",
last_word_connector: ", or"
last_word_connector: ", or "
)
end

View File

@ -10,7 +10,7 @@ end
describe Shoulda::Matchers::ActiveModel::AllowValueMatcher, type: :model do
context "#description" do
it 'describes itself with multiple values' do
it 'describes itself with two values' do
matcher = allow_value('foo', 'bar').for(:baz)
expect(matcher.description).to eq(
@ -18,6 +18,14 @@ describe Shoulda::Matchers::ActiveModel::AllowValueMatcher, type: :model do
)
end
it 'describes itself with more than two values' do
matcher = allow_value('foo', 'bar', 'qux').for(:baz)
expect(matcher.description).to eq(
'allow :baz to be "foo", "bar", or "qux"'
)
end
it 'describes itself with a single value' do
matcher = allow_value('foo').for(:baz)