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