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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:00:33+00:00 2026-06-05T16:00:33+00:00

System: rails 3.2.3 1.9.2p320 ubuntu 12.04 32 bit I am trying to split up

  • 0

System: rails 3.2.3

1.9.2p320

ubuntu 12.04 32 bit

I am trying to split up my rspec tests into contexts for different routes to the profile page but rspec is not liking context. I am new to Rails and Rspec and would appreciate some help.

gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.3'
gem 'mysql2'
gem 'will_paginate', '3.0.3'
gem 'composite_primary_keys'
gem "nifty-generators", :group => :development

# Gems used only for assets and not required
# in production environments by default.
group :assets do
 gem 'sass-rails',   '~> 3.2.3'
 gem 'coffee-rails', '~> 3.2.1'

 gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
gem 'devise'
gem "devise_openid_authenticatable"
gem 'savon'

# To use debugger
gem 'ruby-debug-base19'
gem 'ruby-debug19', :require => 'ruby-debug'
gem 'ruby-debug-ide19'

group :development, :test do
 # Read our readme for detail on our test environment.
 gem 'rspec-rails'
 gem 'capybara'
 gem 'launchy'
 gem 'spork', '~> 0.9.0.rc'
 gem 'guard'
 gem 'guard-rspec'
 gem 'syntax'
 gem "mocha"
 gem 'factory_girl_rails'
 gem 'faker'

# Guard-spork doesn't work with windows but it's
# awesome for other Operating System's.
gem 'guard-spork'

# Gnome notifications
gem 'libnotify'

end

code:
require ‘spec_helper’

describe "qm profile page" do    
 it "shows personalized header text for the profile route" do    
  user = login_user
  context "when using profile route" do
   get path "/profile"
   assert_select("html:root>head>title", "#{user.username}\'s Profile")
   assert_select("h1", "#{user.username}\'s QM Profile")
   end
  user.destroy
 end
end
  • 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-05T16:00:35+00:00Added an answer on June 5, 2026 at 4:00 pm

    You can’t have a context inside an it block.

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

Sidebar

Related Questions

I am using Ubuntu 9.04 I just installed ruby and rails in my system
I'm trying to implement a simple login system in Rails, but when I try
I am trying to get up a simple authentication system with Rails' Restful-Authentication plugin,
I'm trying to create a login system in Rails 3 where I can access
I use the Haml tempate system in my Rails apps and I imported into
I'm trying to setup a routing system for my rails app that allows for
I've been trying to implement a commenting system for my Rails app. Every event
I'm trying to test a case in our Ruby on Rails system where we
I am trying to implement a tagging system for my rails app. I employed
Rails 3.1 has a convenient system which can compress files into .gz files. However,

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.