2023-07-28 21:09:49 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-01-10 11:06:58 +00:00
|
|
|
describe 'NewStatuses', :sidekiq_inline do
|
2023-07-28 21:09:49 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
it 'can be posted' do
|
|
|
|
expect(subject).to have_css('div.app-holder')
|
|
|
|
|
|
|
|
status_text = 'This is a new status!'
|
|
|
|
|
|
|
|
within('.compose-form') do
|
|
|
|
fill_in "What's on your mind?", with: status_text
|
2024-01-04 09:20:32 +00:00
|
|
|
click_on 'Publish!'
|
2023-07-28 21:09:49 +00:00
|
|
|
end
|
|
|
|
|
2023-10-17 14:10:50 +00:00
|
|
|
expect(subject).to have_css('.status__content__text', text: status_text)
|
2023-07-28 21:09:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'can be posted again' do
|
|
|
|
expect(subject).to have_css('div.app-holder')
|
|
|
|
|
|
|
|
status_text = 'This is a second status!'
|
|
|
|
|
|
|
|
within('.compose-form') do
|
|
|
|
fill_in "What's on your mind?", with: status_text
|
2024-01-04 09:20:32 +00:00
|
|
|
click_on 'Publish!'
|
2023-07-28 21:09:49 +00:00
|
|
|
end
|
|
|
|
|
2023-10-17 14:10:50 +00:00
|
|
|
expect(subject).to have_css('.status__content__text', text: status_text)
|
2023-07-28 21:09:49 +00:00
|
|
|
end
|
|
|
|
end
|