Module: ElabsMatchers::Matchers::Persist

Defined in:
lib/elabs_matchers/matchers/persist.rb

Defined Under Namespace

Classes: PersistMatcher

Instance Method Summary collapse

Instance Method Details

#persist(attribute, value) ⇒ Object

Asserts if an assigned value persistes in the database.

Example: post.should persist(:title, “Blog post”)

Parameters:

  • attribute (Symbol)

    The name of the attibute to check if it persisted or not

  • value (Object)

    The value to persist to the attribute



43
44
45
# File 'lib/elabs_matchers/matchers/persist.rb', line 43

def persist(attribute, value)
  PersistMatcher.new(attribute, value)
end