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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:04:05+00:00 2026-06-14T08:04:05+00:00

I’m getting a little bit confused about how to organize my integration tests. Right

  • 0

I’m getting a little bit confused about how to organize my integration tests. Right now, they are organized according to page structure:

post_pages_spec.rb:

require 'spec_helper'

describe "Post pages" do

  describe "show page" do

    describe "post destruction" do

    end

    describe "edit" do

    end

  end

  describe "post creation" do

  end


end

As you can see, delete and edit are inside the show action, because they appear in the show page.

This is another way of organizing them (based on the REST actions):

post_pages_spec.rb:

require 'spec_helper'

describe "Post pages" do

  describe "show page" do

  end

  describe "post destruction" do

  end

  describe "post creation" do

  end

  describe "edit" do

  end
end

Which structure is clearer and easier to maintain?

  • 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-14T08:04:07+00:00Added an answer on June 14, 2026 at 8:04 am

    Assuming you really are asking about integration tests and not controller tests, I like to organize integration tests from the users perspective, and by the type of user. Ex. one file for registered users, one file for admins, one for not registered users, etc and as necessary.

    The justification for this is that I have found, as a general heuristic, that the same user types have the same prerequisites for a feature, and thus fit well together. For example, a registered user viewing a post might have a lot of scenarios focusing on CRUDing existing post content, where a non-registered user might have scenarios focusing on post recommendations. Since is likely that these different perspectives would have different setups and teardowns, it is also likely that they will be easier (ie. DRY-er etc) to maintain separately.

    Also, it reads nice 🙂 Ex:

    describe "Registered User" do
      context 'creating a Post' do
        it "succeeds given all fields are filled out"
        it "displays errors to the author if a field is missing"
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I am using Paperclip to handle profile photo uploads in my app. They upload

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.