mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-11 20:21:10 +00:00
Assert on page contents while progressing through new_statuses
system spec (#34139)
This commit is contained in:
parent
325b55485e
commit
6d5a1fbe1d
|
@ -22,7 +22,11 @@ module ProfileStories
|
||||||
def as_a_logged_in_user
|
def as_a_logged_in_user
|
||||||
as_a_registered_user
|
as_a_registered_user
|
||||||
visit new_user_session_path
|
visit new_user_session_path
|
||||||
|
expect(page)
|
||||||
|
.to have_title(I18n.t('auth.login'))
|
||||||
fill_in_auth_details(email, password)
|
fill_in_auth_details(email, password)
|
||||||
|
expect(page)
|
||||||
|
.to have_css('.app-holder')
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_a_logged_in_admin
|
def as_a_logged_in_admin
|
||||||
|
|
|
@ -5,21 +5,15 @@ require 'rails_helper'
|
||||||
RSpec.describe 'NewStatuses', :inline_jobs, :js, :streaming do
|
RSpec.describe 'NewStatuses', :inline_jobs, :js, :streaming do
|
||||||
include ProfileStories
|
include ProfileStories
|
||||||
|
|
||||||
subject { page }
|
|
||||||
|
|
||||||
let(:email) { 'test@example.com' }
|
let(:email) { 'test@example.com' }
|
||||||
let(:password) { 'password' }
|
let(:password) { 'password' }
|
||||||
let(:confirmed_at) { Time.zone.now }
|
let(:confirmed_at) { Time.zone.now }
|
||||||
let(:finished_onboarding) { true }
|
let(:finished_onboarding) { true }
|
||||||
|
|
||||||
before do
|
before { as_a_logged_in_user }
|
||||||
as_a_logged_in_user
|
|
||||||
visit root_path
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'can be posted' do
|
it 'can be posted' do
|
||||||
expect(subject).to have_css('div.app-holder')
|
visit_homepage
|
||||||
|
|
||||||
status_text = 'This is a new status!'
|
status_text = 'This is a new status!'
|
||||||
|
|
||||||
within('.compose-form') do
|
within('.compose-form') do
|
||||||
|
@ -27,12 +21,12 @@ RSpec.describe 'NewStatuses', :inline_jobs, :js, :streaming do
|
||||||
click_on 'Post'
|
click_on 'Post'
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(subject).to have_css('.status__content__text', text: status_text)
|
expect(page)
|
||||||
|
.to have_css('.status__content__text', text: status_text)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'can be posted again' do
|
it 'can be posted again' do
|
||||||
expect(subject).to have_css('div.app-holder')
|
visit_homepage
|
||||||
|
|
||||||
status_text = 'This is a second status!'
|
status_text = 'This is a second status!'
|
||||||
|
|
||||||
within('.compose-form') do
|
within('.compose-form') do
|
||||||
|
@ -40,6 +34,15 @@ RSpec.describe 'NewStatuses', :inline_jobs, :js, :streaming do
|
||||||
click_on 'Post'
|
click_on 'Post'
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user