title: Rails, Rspec, Capybara::ElementNotFound: Unable to find link or button
body: <p>I have an rspec test in rails that keeps failing, it says: </p>
  
  <pre><code>Failure/Error: click_on "New Part"
  
  Capybara::ElementNotFound:
  Unable to find link or button "New Part"
  </code></pre>
  
  <p>Here is my spec file:</p>
  
  <pre><code>    require "spec_helper"
  describe "Adding and Registering a part" do
  
    it "shows a part not in a class" do
      company1 = Company.create(company_attributes)
      product1 = Product.create(product_1_attributes)
      product1.company = company1
      product1.save
      part1 = Part.new(part1_attributes)
  
      visit parts_path
      click_on "New Part"
      fill_in('part_part_number', :with =&gt; part1.part_number)
      fill_in('part_name', :with =&gt; part1.name)
      fill_in('part_description', :with =&gt; part1.description)
      fill_in('part_manufacturer', :with =&gt; part1.manufacturer)
      click_on "Create Part"
      visit parts_path
      expect(page).to have_text(part1.part_number)
      expect(page).to have_text(part1.name)
      expect(page).to have_text(part1.description)
      expect(page).to have_text(part1.manufacturer)
    end
  
    it "shows a part in a class after Register" do
      company1 = Company.create(company_attributes)
      product1 = Product.create(product_1_attributes)
      product1.company = company1
      product1.save
      part1 = Part.new(part1_attributes)
  
      visit parts_path
      click_on "New Part"
      fill_in('part_part_number', :with =&gt; part1.part_number)
      fill_in('part_name', :with =&gt; part1.name)
      fill_in('part_description', :with =&gt; part1.description)
      fill_in('part_manufacturer', :with =&gt; part1.manufacturer)
      click_on "Create Part"
  
      visit products_path
      click_on "Show"
      click_on "Register Parts"
      click_on "Register"
      expect(page).to have_text("Parts Registered")
      expect(page).to have_text(part1.name)
    end
  end
  </code></pre>
  
  <p>and here is the link that cannot be found by capybara:</p>
  
  <pre><code>&lt;%= link_to 'New Part', new_part_path %&gt;
  </code></pre>
  
  <p>The spelling of "New Part" is exactly the same (I copy and pasted it from the link to the rspec test just to be safe), I have a similar rspec test that is on another page and works.</p>