小编Ser*_*dez的帖子

rspec应该has_select('cars',:options => ['volvo','saab']无效

在主页我有:
汽车:

<select id="cars">
  <option value="volvo">Volvo </option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi </option>
</select>
Run Code Online (Sandbox Code Playgroud)

static_pages_spec.rb中的测试代码:

it "should have the right select" do
  visit home_path
  it { should have_select('cars', :options => ['volvo', 'saab','mercedes','audi'])}
end
Run Code Online (Sandbox Code Playgroud)

回应是

rspec ./spec/requests/static_pages_spec.rb:21 # Static pages Home page should have the right select
Run Code Online (Sandbox Code Playgroud)

ruby rspec ruby-on-rails

5
推荐指数
1
解决办法
3992
查看次数

标签 统计

rspec ×1

ruby ×1

ruby-on-rails ×1