Sha256: a222e4b3643c79d4154cd3d73598f218c8f93e135ff23a1d73f1b06c4eb6f3c7

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

require 'spec_helper'
require 'druid/elements'

describe Druid::Elements::TextField do
  describe "interface" do
    let(:element) { double 'element' }
    let(:text_field) { Druid::Elements::TextField.new(element) }

    it "should set its' value" do
      expect(element).to receive(:set).with('test')
      text_field.value = 'test'
    end

    it "should register with type :text" do
      expect(Druid::Elements.element_class_for(:input, :text)).to be Druid::Elements::TextField
    end

    it "should register with type :password" do
      expect(Druid::Elements.element_class_for(:input, :password)).to be Druid::Elements::TextField
    end

    it "should append text" do
      expect(element).to receive(:append).with('abc')
      text_field.append('abc')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
druid-ts-1.2.4 spec/druid/elements/text_field_spec.rb
druid-ts-1.2.3 spec/druid/elements/text_field_spec.rb