spec/property/locators/text_spec.rb in wombat-2.0.1 vs spec/property/locators/text_spec.rb in wombat-2.1.0
- old
+ new
@@ -9,10 +9,20 @@
property = Wombat::DSL::Property.new('data1', 'xpath=/abc', :text, 'boom')
locator = Wombat::Property::Locators::Text.new(property)
locator.locate(context).should == { "data1" => "Something cool" }
- end
+ end
+
+ it 'should locate text property with xpath selector using xpath functions' do
+ context = double :context
+ context.stub(:xpath).with('concat(/abc, /def)', nil).and_return " Something "
+ property = Wombat::DSL::Property.new('data1', 'xpath=concat(/abc, /def)', :text)
+
+ locator = Wombat::Property::Locators::Text.new(property)
+
+ locator.locate(context).should == { "data1" => "Something" }
+ end
it 'should locate text property with css selector' do
fake_elem = double :element
context = double :context
fake_elem.stub inner_text: "My name"
\ No newline at end of file