您好我正在研究Hartl的rails教程的第9章。我刚刚添加了一些测试来测试“编辑”页面,该页面允许用户编辑他们的个人资料信息。
当我运行'bundle exec rspec spec / requests / user_pages_spec.rb -e“编辑页面”'我得到了“所有示例都被过滤掉了...... 0个例子,0个失败”。这是否意味着没有经过测试?如果是这样,我该如何解决这个问题?
C:\Sites\sample_app>bundle exec rspec spec/requests/user_pages_spec.rb -e "edit
page'
Run options: include {:full_description=>/edit\ page'/}
All examples were filtered out
Finished in 0 seconds
0 examples, 0 failures
user_pages_spec.rb
describe "edit" do
let(:user) { FactoryGirl.create(:user) }
before { visit edit_user_path(user) }
describe "page" do
it { should have_content("Update your profile") }
it { should have_title("Edit user") }
it { should have_link('change', href: 'http://gravatar.com/emails') }
end
describe "with invalid information" do
before { click_button "Save changes" }
it { should have_content('error') }
end
end
答案 0 :(得分:3)
这意味着没有测试过。问题是
-e "edit page'
以错误的报价类型关闭。使用单引号或双引号括起字符串:
-e "edit page"