Sha256: 8f50693e60dad00e38b0a2a190467c952e24761880b9ef7660dd894dec469723

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe Symbiont::WebObjects::Button do
  describe "implementation" do
    let(:button_object) { double('button_object') }
    let(:button) { Symbiont::WebObjects::Button }

    it "should reference standard usable selectors" do
      [:class, :id, :name, :index, :xpath, :value, :src, :alt, :text].each do |s|
        locator = button.provide_locator_for s => 'value'
        locator.keys.first.should == s
      end
    end

    it "should reference specific usable selectors" do
      [:value, :text].each do |s|
        locator = button.provide_locator_for s => 'value'
        locator.keys.first.should == s
      end
    end

    it "should register with a submit type" do
      ::Symbiont::WebObjects.get_class_for(:input, :submit).should == ::Symbiont::WebObjects::Button
    end

    it "should register with a button type" do
      ::Symbiont::WebObjects.get_class_for(:input, :button).should == ::Symbiont::WebObjects::Button
    end

    it "should register with an image type" do
      ::Symbiont::WebObjects.get_class_for(:input, :image).should == ::Symbiont::WebObjects::Button
    end

    it "should register with an image type" do
      ::Symbiont::WebObjects.get_class_for(:input, :reset).should == ::Symbiont::WebObjects::Button
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
symbiont-0.2.1 spec/symbiont/web_objects/button_spec.rb
symbiont-0.2.0 spec/symbiont/web_objects/button_spec.rb