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

Add have_rich_text #1252

Closed
vsppedro opened this issue Nov 10, 2019 · 3 comments
Closed

Add have_rich_text #1252

vsppedro opened this issue Nov 10, 2019 · 3 comments

Comments

@vsppedro
Copy link
Collaborator

vsppedro commented Nov 10, 2019

Hello, first of all, thank you all for maintaining and improving this gem.

So, I was wondering if there it's a possibility to add something like this:

it { is_expected.to have_rich_text(:body) }

To test ActionText with RSpec. Example:

class Post < ApplicationRecord
  has_rich_text :body
end

I would love to work on this if by chance this suggestion is accepted.

Thank you for your time.

EDIT: For now I'm using a custom matcher:

RSpec::Matchers.define :have_rich_text do |expected|
  match do |actual|
    actual.send(expected).class == ActionText::RichText
  end
end
@guialbuk
Copy link
Collaborator

Hi @vsppedro

Your contribution would be appreciated. Feel free to submit a PR, or even a draft one to receive feedback during your progress.

And feel free to ask any questions 🙂

@vsppedro
Copy link
Collaborator Author

vsppedro commented Jan 23, 2020

I will close this issue for now because the PR with the solution has been merged! 🎉

@O330oei
Copy link

O330oei commented Jan 24, 2020 via email

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

No branches or pull requests

3 participants