module ActiveAttr::Matchers
Matchers
that can be used with RSpec and Shoulda to declaritively verify models based on ActiveAttr
modules
@example Integrate with RSPec
require "active_attr/rspec"
@since 0.2.0
Public Instance Methods
have_attribute(attribute_name)
click to toggle source
Specify that a model should have an attribute matching the criteria. See {HaveAttributeMatcher}
@example Person should have a name attribute
describe Person do it { should have_attribute(:first_name) } end
@param [Symbol, String, to_sym] attribute_name
@return [ActiveAttr::HaveAttributeMatcher]
@since 0.2.0
# File lib/active_attr/matchers/have_attribute_matcher.rb, line 18 def have_attribute(attribute_name) HaveAttributeMatcher.new(attribute_name) end