Sha256: 65c0ab012132d7ccd8dcf3366bd70e9525c574fdf18a882047bf15255530149c

Contents?: true

Size: 1.24 KB

Versions: 7

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

describe 'text controls' do
  Given(:main_form) { start_app }

  Then { main_form.text_field_view.class == Mohawk::Adapters::UIA::TextBox }

  context '#text= / #text' do
    context 'edit controls' do
      When { main_form.text_field = 'text we set it to' }
      Then { main_form.text_field == 'text we set it to' }
    end

    context 'multi-line text fields' do
      When { main_form.multiline_text_field = 'multi-line text we set it to' }
      Then { main_form.multiline_text_field == 'multi-line text we set it to' }
    end
  end

  context '#clear_text' do
    context 'edit controls' do
      Given { main_form.text_field = 'text to be cleared' }
      When { main_form.clear_text_field }
      Then { main_form.text_field == '' }
    end

    context 'multi-line text fields' do
      Given { main_form.multiline_text_field = 'multiline text to be cleared' }
      When { main_form.clear_multiline_text_field }
      Then { main_form.multiline_text_field == '' }
    end
  end

  context '#enter_text' do
    context 'masked edit controls' do
      When { main_form.enter_masked_text_field 'abc12345willnotgoin6789' }
      Then { main_form.masked_text_field == '123-45-6789' }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mohawk-1.0 spec/lib/mohawk/text_spec.rb
mohawk-0.4.4 spec/lib/mohawk/text_spec.rb
mohawk-0.4.3 spec/lib/mohawk/text_spec.rb
mohawk-0.4.2 spec/lib/mohawk/text_spec.rb
mohawk-0.4.1 spec/lib/mohawk/text_spec.rb
mohawk-0.4 spec/lib/mohawk/text_spec.rb
mohawk-0.3 spec/lib/mohawk/text_spec.rb