所以我正在测试我的 Rails 模型之一,但系统的 Ruby 一直在崩溃?以前在 Growl 中发生过这种情况,但在 System 的 ruby 中从未发生过。我已经重新启动,它仍在发生。我正在使用Ruby-1.9.3-p194
,同样的崩溃发生在ruby-1.9.3-p0
. 我的规范似乎无害,我不知道为什么会这样。
规格:
对缩进感到抱歉。
需要'spec_helper'
describe "Admin pages" do
subject { page}
describe "when not signed in" do
before { visit admin_path }
it { should have_selector('title', text: 'Sign in') }
end
describe "when signed in as an admin" do
before do
sign_in
visit admin_path
end
describe "Admin navigation menu" do
it { should have_css('.nav-header', text: 'Content') }
it { should have_link('Dashboard', href: admin_path) }
it { should have_link('News', href: admin_posts_path) }
it { should have_link('Events', href: admin_events_path) }
it { should have_link('Photos', href: admin_photos_path) }
it { should have_css('.nav-header', text: 'Your Account') }
it { should have_link('Settings', href: admin_settings_path) }
it { should have_link('Help', href: admin_help_path) }
describe "should be on every admin page" do
after { should have_admin_navigation }
it { visit admin_path }
it { visit admin_posts_path }
it { visit admin_photos_path }
it { visit admin_settings_path }
end
describe "should not be on any other pages" do
before { visit root_path }
it { should_not have_css('#admin-navigation') }
end
end
describe "Dashboard (index) page" do
before { visit admin_path }
it { should have_selector('h3', text: 'Dashboard') }
it { should have_selector('title', text: full_title('Admin Dashboard')) }
end
describe "Posts page" do
before { visit admin_posts_path }
it { should have_selector('h3', text: 'Posts') }
it { should have_selector('table') }
it { should have_selector('th', text: 'Title') }
it { should have_selector('th', text: 'Content') }
it { should have_selector('th', text: 'Published On') }
end
describe "Events page" do
before { visit admin_events_path }
it { should have_selector('h3', text: 'Events') }
it { should have_selector('input') }
end
end
end
系统崩溃报告作为保留格式的要点。
编辑:我通过评论缩小了范围,错误与@second_page
工厂有关。