Module: FriendlyAttributes::Test::Matchers

Defined in:
lib/friendly_attributes/test/matchers.rb

Defined Under Namespace

Classes: HaveFriendlyAttribute

Instance Method Summary collapse

Instance Method Details

#have_friendly_attributes(*args) ⇒ HaveFriendlyAttribute Also known as: have_friendly_attribute

RSpec matcher for checking Friendly attributes. Passes if the model has the specified FriendlyAttributes associated with it.

Examples:

Using the matcher

it { should have_friendly_attributes(String, :ssn, :work_email, :through => UserDetails)        }
it { should have_friendly_attributes(Friendly::Boolean, :is_active, :through => CompanyDetails) }

Returns:



42
43
44
# File 'lib/friendly_attributes/test/matchers.rb', line 42

def have_friendly_attributes(*args)
  HaveFriendlyAttribute.new(self, *args)
end