require 'acceptance_helper'

describe "factlink", type: :feature do
  include ScreenshotTest
  include FeedHelper

  let(:user) { create :user }

  it 'it renders 2 Factlinks' do
    create_default_activities_for user

    sign_in_user(user)

    visit feed_path
    find('label[for=FeedChoice_Personal]').click
    find('.feed-activity:first-child')
    assume_unchanged_screenshot 'feed'
  end
end

require 'acceptance_helper'

describe "factlink", type: :feature do
  include ScreenshotTest
  include FeedHelper

  let(:user) { create :user }

  it 'it renders 2 Factlinks' do
    create_default_activities_for user

    sign_in_user(user)

    visit feed_path
    find('label[for=FeedChoice_Personal]').click
    find('.spec-feed-activity+.spec-loading-indicator-done')
    assume_unchanged_screenshot 'feed'
  end
end

Fix random fails by waiting until the loading indicator has gone
Fix random fails by waiting until the loading indicator has gone
