闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
803 B

  1. require 'rails_helper'
  2. describe 'accounts/show.html.haml' do
  3. before do
  4. allow(view).to receive(:show_landing_strip?).and_return(true)
  5. end
  6. it 'has an h-feed with correct number of h-entry objects in it' do
  7. alice = Fabricate(:account, username: 'alice', display_name: 'Alice')
  8. status = Fabricate(:status, account: alice, text: 'Hello World')
  9. status2 = Fabricate(:status, account: alice, text: 'Hello World Again')
  10. status3 = Fabricate(:status, account: alice, text: 'Are You Still There World?')
  11. assign(:account, alice)
  12. assign(:statuses, alice.statuses)
  13. assign(:stream_entry, status.stream_entry)
  14. assign(:type, status.stream_entry.activity_type.downcase)
  15. render
  16. expect(Nokogiri::HTML(rendered).search('.h-feed .h-entry').size).to eq 3
  17. end
  18. end