title: What is the difference between Rspec have_css, have_selector, and have_field?
body: <p>I have this html.erb Rails form:</p>
  
  <pre><code>&lt;h1 class=new_vendor_header&gt;New Vendor Form&lt;/h1&gt;
  
  &lt;%= form_for(@vendor) do |f| %&gt;
    &lt;%= f.label :name %&gt;
    &lt;%= f.text_field :name, placeholder: "ex: Jeff" %&gt;
    &lt;%= f.submit "Submit" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>This passes:</p>
  
  <pre><code>expect(page).to have_selector('input[placeholder="ex: Jeff"]')
  </code></pre>
  
  <p>But this does not:</p>
  
  <pre><code>expect(page).to have_field('input[placeholder="ex: Jeff"]')
  </code></pre>
  
  <p>and this does not:</p>
  
  <pre><code>expect(page).to have_selector('input[placeholder="ex: Jeff"]')
  </code></pre>
  
  <p>Selector refers to HTML selector right so it refers to html elements?
  have_css I thought looked for CSS but it seems to do more. Here is the example from the cheat sheet:</p>
  
  <pre><code>response.body.should have_css("input", :count =&gt; 3) #True if there are 3 input tags in response
  </code></pre>
  
  <p>And that seems to look for input HTML selectors. </p>
  
  <p>So what is the difference and why do the other two fail in my example?</p>