I have a snippet that looks like this and I'm trying to run a test that expects the placeholder.
<div class="article_creator_isni form-group">
<label class="control-label multi_value optional" for="article_creator_isni">Creator ISNI</label>
<input type="text" name="article[creator_group][][creator_isni]" id="article_creator_group__creator_isni" class="article_creator_group form-control multi-text-field multi_value ubiquity_creator_isni" placeholder="Please enter the creator's ISNI, e.g. 0000 1234 5678 9101." data-field-name="ubiquity_creator_isni">
</div>
I've been able to get it to pass with
expect(page.find(".article_creator_isni input")['placeholder']).to eq 'Please enter the creator\'s ISNI, e.g. 0000 1234 5678 9101.'
Is there a better way to write the expect?
That seems ok to me, you could be more specific by using the id perhaps though?
expect(find("#article_creator_group__creator_isni")["placeholder"]).to eq "Please enter the creator's ISNI, e.g. 0000 1234 5678 9101."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With