← Back to Upcase

Can't search twitter for a term searching by hashtag


(Mike Adeleke) #1

I’m getting this error when running my tests. Don’t know what seems to be the issue. I’m at minute 21 of the TDD Worksop where we work with 3rd part APIs.

search_twiiter_spec.rb

require "spec_helper"

feature "Search twitter for a term" do
  scenario "searching by hashtag" do
    visit root_path
    fill_in "Search", with: "Rails"
    click_button "Search"
    expect(page).to have_css "li.tweet", count: 15
  
    all('li.tweet').each do |tweet|
      expect(tweet.text).to match /#rails/i
    end
  end
end

show.html.erb

<ul>
  <% @tweets.each do |tweet| %>
    <li class="tweet"><%= tweet.text %></li>
  <% end %>
</ul>

(Mike Adeleke) #2

It just passed and I do not know why.