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 4022814
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:31:21+00:00 2026-05-20T10:31:21+00:00

I have carrierwave set up and it processes my images fine. I get nicely

  • 0

I have carrierwave set up and it processes my images fine. I get nicely resized thumb versions in a subfolder and all that. Both from my frontend (HTML) and from my rails console. I use MiniMagic

But in my rspec the thumb test fails always.

describe 'processed images' do
  before(:each) do
    AttachmentUploader.enable_processing = true
    AttachmentUploader.enable_processing = true
    @uploader = AttachmentUploader.new(@post, :image)
    @uploader.store!(File.open(@file))
  end

  after(:each) do
    @uploader.remove!
    AttachmentUploader.enable_processing = false
  end

  describe 'the thumb version' do
    it "should scale down ane image to be exactly 50 by 50 pixels" do
      @uploader.recreate_versions!
      @uploader.thumb.should have_dimensions(50, 50)
    end
  end

@file is a file found in fixtures. It is found and attached (other tests pass). And if I comment out the line @uploader.remove!, It leaves a file in e.g. .../public/uploads/post/image/thumb_fig.png.
That file, however is not resized. When invoking the same sequence trough rails console it gets resized just fine.

Am I missing something in my specs? Do I need to set a special flag? Force a certain method to be ran?

  • 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-20T10:31:22+00:00Added an answer on May 20, 2026 at 10:31 am

    a little late to this party but working on something similar myself. From what I can tell your test looks fine although I believe @uploader.recreate_Versions! is unnecessary. Otherwise check to make sure that you do have a call to process in your Uploader class and that you
    include CarrierWave::Test::Matchers in your tests

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

Sidebar

Related Questions

I have an application that is using both the carrierwave & tire gems. The
I have a model that use both: Carrierwave for store photos, and PaperTrail for
I have a model called Recipe which has 2 images that use carrierwave, so
I have a small Rails 3.2.1 app that uses CarrierWave 0.5.8 for file uploads
I have an CarrierWave ImageUploader which creates a couple of versions of an original
I have a rails 3.1 app and I am adding carrierwave to store images.
I am trying ti use carrierWave. I have installed imagemagic using homebrew and both
How do you get the file extension in a CarrierWave Uploader? I have quite
I currently have a Ruby on Rails project that has CarrierWave running on it.
I have CarrierWave working fine through the typical ORM setup and upload via form.

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.