我想从RSpec的选择列表中选择值。例如我有这样的数据:
<div class="control-group">
<label class="control-label" for="user_teacher_leader_attributes_teacher_id">Teacher names</label>
<div class="controls">
<select id="user_teacher_leader_attributes_teacher_id" name="user[teacher_leader_attributes][teacher_id]">
<option value="1" selected="selected">Math teacher</option>
<option value="2">Physics teacher</option>
</div>
</div>
我想Physics teacher
通过RSpec选择选项。我怎样才能做到这一点?另外,我可以按值从列表中选择一些东西(例如,Physics teacher
按它具有的值“2”选择)吗?