Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend have_body_text matcher to be able to specify which part in multipart to check #196

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eitoball
Copy link
Contributor

@eitoball eitoball commented Mar 18, 2017

I would like to specify which part in multipart is checked by have_body_text matcher. In this PR, I added methods (?); .in_html_part and .in_text_part for have_body_text matcher. For example,

mail = Mail.new do
   html_part do
     body 'This is html'
   end
   text_part do
     body 'This is text'
   end
end

# The current behavior
expect(mail).to have_body_text(/This is html/)
expect(mail).not_to have_body_text(/This is text/)

# Using new methods created in this PR
expect(mail).to have_body_text(/This is html/).in_html_part
expect(mail).to have_body_text(/This is text/).in_text_part
expect(mail).not_to have_body_text(/This is html).in_text_part # Only look for text part

@eitoball eitoball force-pushed the extend-have_body_text-matcher-to-check-agaist-specific-part-in-multipart branch from a99a127 to 41f8782 Compare March 27, 2017 15:50
@lulalala
Copy link

bump @etagwerker

@winniehell
Copy link

@etagwerker can you please take a look at this?

@winniehell
Copy link

@etagwerker is there anything I can do to help get this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants