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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:28:06+00:00 2026-06-08T19:28:06+00:00

I have 6 months of Rails development experience. I’ve built a web application that’s

  • 0

I have 6 months of Rails development experience. I’ve built a web application that’s in use now with authentication and authorization and postgresql db.

I’m moving on to my second Rails application but this time, after lessons learnt, I would like to develop it using TDD, since I noticed its a lot easier to scale it and fix bugs. It’s slow to develop but in the long run its much easier to deal with.

I have heard of Rspec and Cucumber but am thoroughly confused by them.

I would like to know what the difference is between RSpec and Cucumber and what they are used for.

It would also be useful to know if, from the perspective of a beginner (who is also the sole developer) whether a testing framework is really needed.

  • 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-08T19:28:08+00:00Added an answer on June 8, 2026 at 7:28 pm

    RSpec and Cucumber are both testing frameworks. RSpec includes traditional Unit Testing (which means testing a class or part of the application in isolation from the rest of the application. So your model does what your model is supposed to do, the controller does what it is supposed to do, etc).

    RSpec and Cucumber both are used for Acceptance Testing (Which is called ATDD, BDD, Specification by Example, etc depending on who you ask). These are business-case driven Integration Tests, which mean they simulate the way a user uses the application and uses the full Rails stack so problems with the way the different parts of your application work together can be found in a way that unit testing will not find.

    The main difference between RSpec and Cucumber are the business readability factor. Cucumber’s main draw is that the specification (features) are separate from the test code, so your product owners can provide or review the specification without having to dig through code. These are the .feature files that you make in Cucumber. RSpec has a similar mechanism, but instead you describe a step with a Describe, Context or It block that contains the business specification, and then immediately have the code that executes that statement. This approach is a little easier for developers to work with but a little harder for non-technical folks.

    Which to use? If you are the sole developer and product owner, then I would stick with RSpec, I feel it’s easier to a technical person to understand, offers a few advantages in keeping things scoped and under control, and keep you out of messing with RegExs for test steps. If you are building this for a client, and they are hands-on with regard to the Specification, go with Cucumber for your Acceptance Test and use RSpec for Unit Tests.

    Just to demonstrate the main difference between the two:

    Cucumber:

    #articles.feature
    Given an article exists called "Testing Demonstration"
    When I visit the list of articles
    Then I should see an article called "Testing Demonstration"
    
    #article_steps.rb
    Given /^an article exists called "(.+)"$/ do |title|
      FactoryGirl.create(:article, title: title)
    end 
    When /^I visit the list of articles$/ do
      visit articles_path
    end
    Then /^I should see an article called "(.+)"$/ do |title|
      page.should have_content title
    end
    

    Rspec

    describe "Articles" do
      let(:article) { FactoryGirl.create(:article) }
      context "Index Page" do
        before { visit articles_path }
        it { page.should have_content article.title }
      end
    end
    

    This blog series is excellent on getting going with RSpec.

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

Sidebar

Related Questions

I have done a few months of development with Qt (built GUI programmatically only)
I have been into rails for the last 3 months. Now I wish to
I have been building a Rails application that performs accounting functionality. As part of
I have a Rails app that has been running fine for months. The other
I have a Ruby On Rails Application that has been going for about 9
Im a newbie rails and web developer. I have some experience with iOS. Im
The last months I have tried to get started with web developing using Java.
I have a website that in a few months is going to have traffic
I have been using SimpleRepository for months now, and for the first time i
I'm sure someone can explain this. we have an application that has been in

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.