Files
mastodon/spec/system/home_spec.rb
Claire 73f77c49d8 Merge commit '16c41e035bdd6e08927c950aeeb5332adbe8b6d5' into glitch-soc/merge-upstream
Conflicts:
- `lib/mastodon/version.rb`:
  Upstream bumped the Mastodon API version, glitch-soc has an extra glitch version.
  Bumped the Mastodon API version as upstream did.
2026-03-16 18:16:56 +01:00

67 lines
1.7 KiB
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Home page' do
context 'when signed in' do
before { sign_in Fabricate(:user) }
it 'visits the homepage and renders the web app' do
visit root_path
expect(page)
.to have_css('noscript', text: /Mastodon/)
.and have_css('body', class: 'app-body')
expect(find('.app-holder#mastodon')['data-props'])
.to eq('{"locale":"en"}')
end
end
context 'when not signed in' do
it 'visits the homepage and renders the web app' do
visit root_path
expect(page)
.to have_css('noscript', text: /Mastodon/)
.and have_css('body', class: 'app-body')
end
context 'when the landing page is set to about' do
before do
Setting.landing_page = 'about'
end
it 'visits the root path and is redirected to the about page', :js do
visit root_path
expect(page).to have_current_path('/about')
end
end
context 'when the landing page is set to trends' do
before do
Setting.landing_page = 'trends'
end
it 'visits the root path and is redirected to the trends page', :js do
visit root_path
expect(page).to have_current_path('/explore')
end
end
context 'when the landing page is set to local_feed' do
before do
Setting.local_live_feed_access = 'public' # glitch-soc defaults to "authenticated"
Setting.landing_page = 'local_feed'
end
it 'visits the root path and is redirected to the local live feed page', :js do
visit root_path
expect(page).to have_current_path('/public/local')
end
end
end
end