Sha256: ce48c8d7ebf230e4199a8c73e7b0b376be810464d1a593e391aeff1a14f82d69
Contents?: true
Size: 1.4 KB
Versions: 3
Compression:
Stored size: 1.4 KB
Contents
require 'spec_helper' describe Furter::Accessors::Text do let(:placeholder) { Furter::Accessors::Text.new(:placeholder => 'Placeholder Text') } let(:label) { Furter::Accessors::Text.new(:label => 'accessibilityLabel') } context 'locating text fields' do it 'should work by placeholder' do placeholder.send(:selector).should eq("textField placeholder:'Placeholder Text'") end it 'should work by accessibility label' do label.send(:selector).should eq("textField marked:'accessibilityLabel'") end end it 'can get text' do placeholder.should_receive(:frankly_map).with(anything, 'text').and_return(['expected text']) placeholder.get_text.should eq('expected text') end it 'can set text' do placeholder.should_receive(:frankly_map).with(anything, 'becomeFirstResponder').ordered placeholder.should_receive(:frankly_map).with(anything, 'setText:', 'the new text').ordered placeholder.should_receive(:frankly_map).with(anything, 'endEditing:', true).ordered placeholder.set_text 'the new text' end it 'knows if text exists anywhere' do placeholder.should_receive(:element_exists).with("view marked:'to find anywhere'") placeholder.has_text? 'to find anywhere' end it 'knows whether we are editable or not' do placeholder.should_receive(:frankly_map).with(anything, 'isEnabled').and_return([true]) placeholder.should be_enabled end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
furter-0.0.3.2 | spec/lib/furter/accessors/text_spec.rb |
furter-0.0.3.1 | spec/lib/furter/accessors/text_spec.rb |
furter-0.0.3 | spec/lib/furter/accessors/text_spec.rb |