module

Marten::Spec

Provides helpers and tools allowing to ease the process of writing specs for Marten projects.

Class methods

clear_client

Clears the testing client.

This method is automatically called after each spec.

Source
clear_collected_emails

Clears collected emails.

This method is only relevant if the current emailing backend is an instance of Marten::Emailing::Backend::Development that was initialized with collect_emails: true.

This method is automatically called after each spec.

Source
client

Returns an instance of the testing client.

The testing client allows to issue requests to the server and obtain the associated responses. Note that this method is memoized on a per-spec basis.

Source
delivered_emails

Returns an array of all the emails that were delivered as part of the spec.

Note that this method will return an empty array if the emailing backend is not set to an instance of the development backend that was initialized with collect_emails: true. For example:

Marten.configure :test do |config|
  # [...]
  config.emailing.backend = Marten::Emailing::Backend::Development.new(collect_emails: true, print_emails: false)
end
Source
flush_databases

Flushes all the databases.

This method is automatically called after each spec.

Source
setup_databases

Setup all the databases by ensuring that model tables are up-to-date.

This method is automatically called before each spec suite.

Source

Nested types