I have simple model that looks like this:
class User < ActiveRecord::Base
belongs_to :administration
validates :administration, presence: true, allow_blank: true
end
and spec that looks like this:
require 'spec_helper'
describe User, type: :model do
it { is_expected.to validate_presence_of(:administration).allow_blank }
end
running this spec returns me:
NoMethodError:
undefined method `allow_blank' for #<Shoulda::Matchers::ActiveModel::ValidatePresenceOfMatcher:0x0000000b7f27a8>
Why?