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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:32:17+00:00 2026-06-03T22:32:17+00:00

Learning how to test is HARD! I’m just trying to get MiniTest running and

  • 0

Learning how to test is HARD! I’m just trying to get MiniTest running and man, it is a STRUGGLE. I have watched Ryan’s RailsCasts and read all of the documentation I could find on the subject.

I am only doing (or attempting to do) testing for helpers, models, and requests. Right now, my model and helper tests are just stubbed out to flunk.

However, I have real authentication integration tests written, and they aren’t even being RUN!!! Look at this:

➜  myapp git:(master) rake
==============================================================================
SUITE test/factories,test/helpers,test,test/models,test/requests (SEED 41025)
==============================================================================
User
     0001 must be a real test                                  0:00:00.005 FAIL
 0:00:00.005 ERROR
==============================================================================
SUITE test/factories,test/helpers,test,test/models,test/requests (SEED 12794)
==============================================================================
SessionsHelper
     0001 must be a real test                                  0:00:00.006 FAIL
 0:00:00.006 ERROR
Errors running models, helpers!

Well that is just super, it failed on those like it was supposed to. Now why isn’t it running the stuff from the “test/requests” directory!

require 'minitest_helper'

describe "Login Integration" do

  it "authenticates a user with a password" do
    login_user
    assert page.has_content?('Logged in')
  end

  it "fails to authenticate a user with a mismatched password" do
    user = FactoryGirl.create(:user)
    visit login_path
    fill_in "Email", :with => user.email
    fill_in "Password", :with => "bad password"
    click_button "Log In"
    assert page.has_content?('Invalid email or password')
  end

  it "logs out a user" do
    login_user
    click_link "Log Out"
    assert page.has_content?('Logged out')
  end

end

I can type “Joe Blow” in the middle of the file, and I’m not even getting a syntax error. There is zero reason whatsoever for this file not to get picked up. See the name, “Login Integration”? Well, it’s bound in my minitest_helper.rb like so:

class IntegrationTest < MiniTest::Spec
  include Rails.application.routes.url_helpers
  include Capybara::DSL
  register_spec_type(/integration$/i, self)
end

It sure looks just a tad bit early to be including this stuff in the Rails 4 codebase if this is where we’re at with it. Can anyone tell me what I’m doing wrong?

  • 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-06-03T22:32:18+00:00Added an answer on June 3, 2026 at 10:32 pm

    I am lucky I figured this out. Testing stops after 2 failed tests. I have found no documentation on this whatsoever.

    So if you stub out your tests, just do it like this:

    describe User do
    
      it "needs a real test"
    
    end
    

    That will cause it to “SKIP” the test, and continue on.

    Do NOT do it like this:

    describe User do
    
      it "must have a real test" do
    
        flunk "needs a real test"
    
      end
    
    end
    

    Because if you do, the testing will mysteriously stop, and there won’t be anything to tell you why.

    I like to have my model and helper tests stubbed out. Then I build my integration tests, and supplement with any unit tests I need along the way. I can still do that with MiniTest, it just stops after 2 errors. I haven’t read the code, perhaps there is some way to configure that threshold.

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

Sidebar

Related Questions

I am in the process of learning to unit test. I have a 'domain
I am learning how to write test cases using Rspec. I have a simple
I am learning Python (2.7) and to test what I have learned so far
I am learning some new things in C++, and I was trying to test
I'm learning how to use OCMock to test my iPhone's project and I have
Just learning LINQ and i've come to a newbie roadblock in my test project.
I'm learning power shell and stuck with the problem I have test.ps1: Test Function
I'm currently learning hadoop and I'm trying to setup a single node test as
I have a small test database I'm using for learning SQL. There's a Duel
I am learning objective-c and I get some trouble with delegates. In a test

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.