require 'spec_helper'

describe 'Feeds' do

  subject { page }

  before(:each) do
  end


  describe "latency_tester with connection" do
    let!(:latency_tester) {FactoryGirl.create(:latency_tester)}

    before(:each) do
      visit admin_latency_testers_path
    end

    it "shows connection info" do
      should have_selector('td', text: "last updated at: #{latency_tester.connection.updated_at}")
    end
  end

  describe "latency_tester with no connection" do
    let!(:latency_tester) {FactoryGirl.create(:latency_tester, client_id: 'abc', make_connection: false)}

    before(:each) do
      visit admin_latency_testers_path
    end

    it "shows no connection" do
      should have_selector('td', text: "no connection")
    end
  end


end
