システム: レール 3.2.3
1.9.2p320
Ubuntu 12.04 32ビット
rspec テストをプロファイル ページへのさまざまなルートのコンテキストに分割しようとしていますが、rspec はコンテキストを好みません。私は Rails と Rspec を初めて使用するので、助けていただければ幸いです。
宝石ファイル:
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
コード: '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