spec/druid/page_populator_spec.rb in druid-ts-1.1.8 vs spec/druid/page_populator_spec.rb in druid-ts-1.2.0
- old
+ new
@@ -7,10 +7,11 @@
text_area(:ta, :id => 'id')
select_list(:sl, :id => 'id')
checkbox(:cb, :id => 'id')
radio_button(:rb, :id => 'id')
file_field(:ff, :id => 'id')
+ radio_button_group(:rbg, :id => 'id')
end
describe Druid::PagePopulator do
let(:driver) { mock_driver }
let(:druid) { DruidPagePopulator.new(driver) }
@@ -70,13 +71,12 @@
expect(druid).to receive(:select_rb)
expect(druid).to receive(:is_enabled?).and_return(true)
druid.populate_page_with('rb' => true)
end
- it "should clear a radio button when false is specified" do
- expect(druid).to receive(:clear_rb)
- expect(druid).to receive(:is_enabled?).and_return(true)
- druid.populate_page_with('rb' => false)
+ it "should select the correct element from a radio button group" do
+ expect(druid).to receive(:select_rbg).with('blah')
+ druid.populate_page_with('rbg' => 'blah')
end
it "should not populate a checkbox if it is disabled" do
expect(druid).not_to receive(:check_cb)
expect(druid).to receive(:cb_element).twice.and_return(driver)