new_statuses_spec.rb 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe 'NewStatuses' do
  4. include ProfileStories
  5. subject { page }
  6. let(:email) { 'test@example.com' }
  7. let(:password) { 'password' }
  8. let(:confirmed_at) { Time.zone.now }
  9. let(:finished_onboarding) { true }
  10. before do
  11. as_a_logged_in_user
  12. visit root_path
  13. end
  14. it 'can be posted' do
  15. expect(subject).to have_css('div.app-holder')
  16. status_text = 'This is a new status!'
  17. within('.compose-form') do
  18. fill_in "What's on your mind?", with: status_text
  19. click_on 'Publish!'
  20. end
  21. expect(subject).to have_selector('.status__content__text', text: status_text)
  22. end
  23. it 'can be posted again' do
  24. expect(subject).to have_css('div.app-holder')
  25. status_text = 'This is a second status!'
  26. within('.compose-form') do
  27. fill_in "What's on your mind?", with: status_text
  28. click_on 'Publish!'
  29. end
  30. expect(subject).to have_selector('.status__content__text', text: status_text)
  31. end
  32. end