【发布时间】:2013-06-08 02:21:24
【问题描述】:
我的index_spec.rb中有以下代码
require '../../spec_helper'
describe "Dashboards" do
describe "Welcome Widget" do
it "should have the content" do
visit '../../dashboards/index'
page.should have_content('Random Content.')
end
end
end
我跑了rspec index_spec.rb,它没有说'unidentified method visit',然后我在网上搜索并在spec_helper.rb中包含以下内容
require 'capybara'
include Capybara::DSL
当我包含它时,它在spec_helper.rb: 1 处显示“syntax error, unexpected tIDENTIFIER, expecting $end”,我已经尝试了过去三个小时,无法弄清楚我需要将“结束”放在 spec_helper 文件中的哪个位置。让我知道是否有人使用 rspec 进行破折号和验证仪表板文件
【问题讨论】: