Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5957203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:22:02+00:00 2026-05-22T18:22:02+00:00

I am planning on using the Sanitize gem in a Rails project as a

  • 0

I am planning on using the Sanitize gem in a Rails project as a way of cleaning user-submitted HTML snippets. The gem source on Github includes a robust set of tests, though they are not included in the final gem. In my model tests, I want to again verify that the gem does what it should be doing and that my model only stores clean HTML. It seems like overkill to have to recreate all of the gem tests in my model test, and I would prefer to have my test just make sure that the model’s before_save filter (which calls on the Sanitize gem) works. What is the best way to handle this?

On a side note, while researching this I came across the GemTester area of RubyGems, which looks really promising, but requires gem authors to opt-in each gem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:22:03+00:00Added an answer on May 22, 2026 at 6:22 pm

    I don’t know if this will be the answer you’re looking for, but my general principle is to not write tests for third party libraries. Rather, write tests for your integration points with those libraries, or the code that you’re writing on top of those libraries. I would include a test to perhaps make sure that the before_save filter is being called correctly and leave it at that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with a little project that I'm planning on using HTML5 in. So
I am building an application and I am planning on using OpenSSL for securing
I am using C# 3.0 / .NET 3.5 and planning to build an eCommerce
I was using CodeRush quite while ago and now I'm planning to use it
I'm planning to make a very simple program using php and mySQL. The main
I'm working on a game (using Ruby) and planning to have it available in
I am developing an online exam using JSP/Servlets which is nearing completion. I'm planning
We are planning on moving for MS Source Safe (ouch) to SVN. We are
I am planning to extend the basic html input tag provided by Spring to
Planning of using t4 template in a production environment. I have not used this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.