× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

rails - rspec - why does this "validates_inclusion_of :role, :in => %w[one, two, three ] }" not work

Jul 08, 2015
<p>There <strong>is</strong> a shoulda matcher <code>validate_inclusion_of</code>.</p> <p><code>ensure_inclusion_of</code> <a href="https://github.com/thoughtbot/shoulda-matchers/blob/master/NEWS.md" rel="nofollow">is deprecated</a> and will be removed in the next major release.</p> <p>Are you sure your code is inside a <code>describe Model do</code> block?</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/11697597/rails%20-%20rspec%20-%20why%20does%20this%20%22validates_inclusion_of%20:role,%20:in%20=&gt;%20%w%5Bone,%20two,%20three%20%5D%20%7D%22%20not%20work%20/28305658">Stack Overflow</a>.</p>
comments powered by Disqus