FAQ Database Discussion Community


Get the actual value of a boolean attribute

ruby,page-object-gem,rspec3,rspec-expectations
I have the span: <span disabled="disabled">Edit Member</span> When I try to get the value of the disabled attribute: page.in_iframe(:id => 'MembersAreaFrame') do |frame| expect(page.span_element(:xpath => "//span[text()='Edit Member']", :frame => frame).attribute('disabled')).to eq("disabled") end I get: expected: "disabled" got: "true" How do I get the value of specified attribute instead of a...

Can I alias a nested RSpec matcher?

ruby,rspec,rspec3,rspec-expectations
I have several RSpec examples that share the following complex expectation, with the array records and the floating point numbers min_long, max_long, min_lat, max_lat varying between these examples. expect(records).to all have_attributes( shape: have_attributes( exterior_ring: have_attributes( points: all( have_attributes( longitude: be_between(min_long, max_long), latitude: be_between(min_lat, max_lat) ) ) ) ) ) (The...