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

  • Home
  • SEARCH
  • 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 6980237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:59:23+00:00 2026-05-27T17:59:23+00:00

I have a pretty simple model: class SocialGroup < ActiveRecord::Base validates :name, presence: true

  • 0

I have a pretty simple model:

class SocialGroup < ActiveRecord::Base
  validates :name, presence: true
  validates :file, presence: true

  mount_uploader :file, SocialGroupFileUploader
end

And the question is: Should I test (with rspec) the model successful save with valid file type provided (my white list of file extensions includes only csv)? Or should I test the file uploader in isolation? If answer on first question is Yes, how test shoul look like?

  • 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-27T17:59:24+00:00Added an answer on May 27, 2026 at 5:59 pm

    If your uploader is simple I think it’s fairly safe to assume that CarrierWave’s developers have done the testing there, the test suite is fairly comprehensive (but it’s very much a matter of opinion, some people will and some people won’t).

    I’d concentrate on making sure that the controller is tested either in rspec or the cucumber specs. There are a couple of examples of people doing this in a google search.

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

Sidebar

Related Questions

Look, I have these pretty simple model Master-Detail: Hand is master of Fingers (finger
I have the following two models, User.. class User < ActiveRecord::Base has_and_belongs_to_many :sites end
I have a pretty simple console project with an entity model (containing two simple
I have what looks to me to be a pretty simple setup of model,
Say I have a simple model like these (small part of a pretty large
My situation I have an entity model with a base class ItemBase which defines
I have a pretty simple form with some fields from a doctrine model. $this->widgetSchema['fields']
i have pretty simple simple question (i hope so). How do i change the
I have a pretty simple ASP.NET Web Form that looks a bit like the
I have a pretty simple Linq to XML query: var q = from c

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.