nas/spec/system/new_statuses_spec.rb
2025-06-12 10:37:20 +09:00

38 lines
891 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'NewStatuses', :inline_jobs, :js, :streaming do
include ProfileStories
let(:email) { 'test@example.com' }
let(:password) { 'password' }
let(:confirmed_at) { Time.zone.now }
let(:finished_onboarding) { true }
let(:status_text) { 'This is a new status!' }
before do
as_a_logged_in_user
page.set_viewport_size(width: 1600, height: 1050)
end
it 'can be posted' do
visit_homepage
within('.compose-form') do
fill_in frontend_translations('compose_form.placeholder'), with: status_text
click_on 'Post'
end
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