Skip to content
Snippets Groups Projects
show.html.haml_spec.rb 803 B
Newer Older
  • Learn to ignore specific revisions
  • require 'rails_helper'
    
    
    Matt Jankowski's avatar
    Matt Jankowski committed
    describe 'accounts/show.html.haml' do
    
      before do
    
    Matt Jankowski's avatar
    Matt Jankowski committed
        allow(view).to receive(:show_landing_strip?).and_return(true)
    
    Matt Jankowski's avatar
    Matt Jankowski committed
      it 'has an h-feed with correct number of h-entry objects in it' do
    
        alice   =  Fabricate(:account, username: 'alice', display_name: 'Alice')
        status  =  Fabricate(:status, account: alice, text: 'Hello World')
    
    Matt Jankowski's avatar
    Matt Jankowski committed
        status2 =  Fabricate(:status, account: alice, text: 'Hello World Again')
        status3 =  Fabricate(:status, account: alice, text: 'Are You Still There World?')
    
    
        assign(:account, alice)
    
    Matt Jankowski's avatar
    Matt Jankowski committed
        assign(:statuses, alice.statuses)
        assign(:stream_entry, status.stream_entry)
        assign(:type, status.stream_entry.activity_type.downcase)
    
    Matt Jankowski's avatar
    Matt Jankowski committed
        render
    
    Matt Jankowski's avatar
    Matt Jankowski committed
        expect(Nokogiri::HTML(rendered).search('.h-feed .h-entry').size).to eq 3