我有一个未运行的 Rails 功能测试。当我尝试 $ rspec spec/features
或 $ rspec
我得到这个输出:
No examples found.
Finished in 0.00005 seconds
0 examples, 0 failures
这是我的功能测试中应该运行的代码:
# spec/features/alpha_sign_ups.rb
require 'spec_helper'
feature 'Alpha user sign ups' do
scenario 'with a valid email' do
visit root_path
fill_in 'Email', with: "test@test.com"
click_button 'Request Early Access'
expect(page).to have_content('whatever')
end
end
最佳答案
我的文件没有 _spec.rb
后缀。 Rspec 仅将具有此后缀的文件作为测试运行。
关于ruby-on-rails - Rails 功能测试未运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20812981/