2024-08-26 15:53:48 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-09-04 05:12:25 +00:00
|
|
|
RSpec.describe 'Home page' do
|
2024-08-26 15:53:48 +00:00
|
|
|
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/)
|
2024-11-15 15:49:26 +00:00
|
|
|
.and have_css('body', class: 'app-body')
|
2024-08-26 15:53:48 +00:00
|
|
|
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/)
|
2024-11-15 15:49:26 +00:00
|
|
|
.and have_css('body', class: 'app-body')
|
2024-08-26 15:53:48 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|