Assert on page contents while progressing through new_statuses system spec (#34139)
				
					
				
			This commit is contained in:
		@@ -5,21 +5,15 @@ require 'rails_helper'
 | 
			
		||||
RSpec.describe 'NewStatuses', :inline_jobs, :js, :streaming do
 | 
			
		||||
  include ProfileStories
 | 
			
		||||
 | 
			
		||||
  subject { page }
 | 
			
		||||
 | 
			
		||||
  let(:email)               { 'test@example.com' }
 | 
			
		||||
  let(:password)            { 'password' }
 | 
			
		||||
  let(:confirmed_at)        { Time.zone.now }
 | 
			
		||||
  let(:finished_onboarding) { true }
 | 
			
		||||
 | 
			
		||||
  before do
 | 
			
		||||
    as_a_logged_in_user
 | 
			
		||||
    visit root_path
 | 
			
		||||
  end
 | 
			
		||||
  before { as_a_logged_in_user }
 | 
			
		||||
 | 
			
		||||
  it 'can be posted' do
 | 
			
		||||
    expect(subject).to have_css('div.app-holder')
 | 
			
		||||
 | 
			
		||||
    visit_homepage
 | 
			
		||||
    status_text = 'This is a new status!'
 | 
			
		||||
 | 
			
		||||
    within('.compose-form') do
 | 
			
		||||
@@ -27,12 +21,12 @@ RSpec.describe 'NewStatuses', :inline_jobs, :js, :streaming do
 | 
			
		||||
      click_on 'Post'
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    expect(subject).to have_css('.status__content__text', text: status_text)
 | 
			
		||||
    expect(page)
 | 
			
		||||
      .to have_css('.status__content__text', text: status_text)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  it 'can be posted again' do
 | 
			
		||||
    expect(subject).to have_css('div.app-holder')
 | 
			
		||||
 | 
			
		||||
    visit_homepage
 | 
			
		||||
    status_text = 'This is a second status!'
 | 
			
		||||
 | 
			
		||||
    within('.compose-form') do
 | 
			
		||||
@@ -40,6 +34,15 @@ RSpec.describe 'NewStatuses', :inline_jobs, :js, :streaming do
 | 
			
		||||
      click_on 'Post'
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    expect(subject).to have_css('.status__content__text', text: status_text)
 | 
			
		||||
    expect(page)
 | 
			
		||||
      .to have_css('.status__content__text', text: status_text)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def visit_homepage
 | 
			
		||||
    visit root_path
 | 
			
		||||
 | 
			
		||||
    expect(page)
 | 
			
		||||
      .to have_css('div.app-holder')
 | 
			
		||||
      .and have_css('form.compose-form')
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user