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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:41:34+00:00 2026-06-13T20:41:34+00:00

Being Rspec noob, i dont know this question make sense. BUt i am really

  • 0

Being Rspec noob, i dont know this question make sense. BUt i am really confused and couldnt get solution for this.

We have one new requirement, asked us to write Rspec test cases for existing project. They have application with rails3 that already working but they want rspec cases to be written now

My question is

Writing Rspec cases for existing application does make sense?

Can we write spec for already working project

Should we follow any guidelines to write specs for already written app

Thank you

  • 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-13T20:41:36+00:00Added an answer on June 13, 2026 at 8:41 pm

    As dpassage rightly pointed, your question has nothing to do with rspec. It’s about unit testing a legacy code.

    Writing Rspec cases for existing application does make sense?
    Can we write spec for already working project

    Yes. It’s best when you write your tests first before you write the application. It’s never too late to write tests, starting late does not hurt.
    Testing legacy code: Adding unit tests to legacy code

    Should we follow any guidelines to write specs for already written app

    My two cents on this:

    • Add tests incrementally

    • Test first the most important parts of your application. i.e. Start writing the unit tests first and focus on important models (instead of all models). Once you test your models move to functional tests(controllers) and integration tests. Remember: To eat an elephant we need to eat one piece at a time.

    • If your existing models are difficult to write test, it implies that you need to refactor your code. Refactor to make your models simple to test.

    • Always write unit tests for new models/implementation from NOW.

    Useful references:

    • TDD by example – Kent beck book
    • Effective testing: http://www.confreaks.com/videos/917-railsconf2012-testing-best-practices-or-the-five-habits-of-highly-effective-tests
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(I'm using rspec in RoR, but I believe this question is relevant to any
Being spotted in context of this question this seemingly inconsistent behavior can be reproduced
When running some test with RSpec, I get this error (multiple times): 1) User
I suspect I just being very dumb with this and missing something obvious. But
Being new to OpenCL i would like to know if the following scenario is
I'm trying to inject an after_save callback via a mixin, but my rspec tests
Autotest broke with rspec-rails 2.2.1 update. Now I can't get it working again.. .even
I am a newbie to Rails 3 and Rspec. Kindly excuse my being a
I am a newbie to Rails 3 and Rspec. Kindly excuse my being a
I had problems for ages in RSpec with my models not being reloaded between

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.