Sha256: 23e4ff9027f12f93f8cb189b8b541cd9219a462d4c9ba2a29966da8edc2a5ac4

Contents?: true

Size: 950 Bytes

Versions: 1

Compression:

Stored size: 950 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper.rb'

describe "Radios" do

  before :all do
    @browser = Browser.new(BROWSER_OPTIONS)
  end

  before :each do
    @browser.goto(HTML_DIR + "/forms_with_input_elements.html")
  end

  describe "#length" do
    it "returns the number of radios" do
      @browser.radios.length.should == 5
    end
  end

  describe "#[]" do
    it "returns the radio button at the given index" do
      @browser.radios[1].id.should == "new_user_newsletter_yes"
    end
  end

  describe "#each" do
    it "iterates through radio buttons correctly" do
      index = 1
      @browser.radios.each do |r|
        r.name.should == @browser.radio(:index, index).name
        r.id.should ==  @browser.radio(:index, index).id
        r.value.should == @browser.radio(:index, index).value
        index += 1
      end
      @browser.radios.length.should == index - 1
    end
  end

  after :all do
    @browser.close
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caius-celerity-0.0.6.11 spec/radios_spec.rb