{"id":26070490,"url":"https://github.com/contently/action_mailer_matchers","last_synced_at":"2025-03-09T00:01:50.642Z","repository":{"id":141763128,"uuid":"65679554","full_name":"trilogy-group/contently-action_mailer_matchers","owner":"trilogy-group","description":"ActionMailerMatchers provides rspec matchers to test Rails' common ActionMailer functionality.","archived":true,"fork":false,"pushed_at":"2018-11-19T21:53:37.000Z","size":11,"stargazers_count":51,"open_issues_count":0,"forks_count":4,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-02T17:01:57.413Z","etag":null,"topics":["actionmailer","matcher","rails","rspec","rspec-matchers","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trilogy-group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-14T18:03:56.000Z","updated_at":"2024-10-08T08:01:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2b08719-6401-4a81-914e-e4799aeaf8fc","html_url":"https://github.com/trilogy-group/contently-action_mailer_matchers","commit_stats":{"total_commits":7,"total_committers":3,"mean_commits":"2.3333333333333335","dds":0.5714285714285714,"last_synced_commit":"6cb18758d08e5b102a37887f7dc31fbc66cc07dc"},"previous_names":["trilogy-group/contently-action_mailer_matchers","contently/action_mailer_matchers"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trilogy-group%2Fcontently-action_mailer_matchers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trilogy-group%2Fcontently-action_mailer_matchers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trilogy-group%2Fcontently-action_mailer_matchers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trilogy-group%2Fcontently-action_mailer_matchers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trilogy-group","download_url":"https://codeload.github.com/trilogy-group/contently-action_mailer_matchers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242623560,"owners_count":20159703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actionmailer","matcher","rails","rspec","rspec-matchers","ruby"],"created_at":"2025-03-09T00:00:45.724Z","updated_at":"2025-03-09T00:01:50.618Z","avatar_url":"https://github.com/trilogy-group.png","language":"Ruby","funding_links":[],"categories":["Matchers"],"sub_categories":[],"readme":"# ActionMailerMatchers\n\nActionMailerMatchers provides RSpec matchers to test common ActionMailer functionality.\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngroup :test do\n  gem 'action_mailer_matchers', '~\u003e 1.0'\nend\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install action_mailer_matchers\n\nInclude ActionMailerMatchers in your RSpec config by requiring it and including in your configuration block.\n\n```ruby\nrequire \"action_mailer_matchers\"\n\n...\n\nRSpec.configure do |config|\n  config.include ActionMailerMatchers\nend\n```\n\n## Usage\n\nActionMailer allows you to send emails in your Rails application, ActionMailerMatchers provides you with RSpec one-liners that help you to test this functionality. \n\nIt is typical to test that an email has been delivered by doing the following: \n\n```ruby\nexpect { some_action.execute }\n .to change { ActionMailer::Base.deliveries.count }.by(1)\n```\n\nHowever, this does not specify what email was sent and to where. ActionMailerMatchers solves this problem by providing the `have_received_email` matcher, which ensures that the passed email address or user (which must respond `.email`) was the email's \"to\" address. You may also use the optional subject and body arguments to check that content matches the email you were expecting to send.\n\n```ruby\nexpect(some_user).to have_received_email(subject: \"My great subject\")\nexpect(\"address@email.com\").to have_received_email(body: \"Wonderful email body\")\n```\n\nYou can also test that someone has not received an email.\n\n```ruby\nexpect(some_user).not_to have_received_email\n```\n\nEmails sent to users using `bcc` or `cc` can be tested using:\n\n```ruby\nexpect(\"cc@email.com\").to have_received_cc_email(body: \"Wonderful email body\")\nexpect(\"bcc@email.com\").to have_received_bcc_email(body: \"Wonderful email body\")\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/contently/action_mailer_matchers/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontently%2Faction_mailer_matchers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontently%2Faction_mailer_matchers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontently%2Faction_mailer_matchers/lists"}