On the home page I have:
Cars:
<select id="cars">
<option value="volvo">Volvo </option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi </option>
</select>
Verification code in 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
Answer
rspec ./spec/requests/static_pages_spec.rb:21
source
share