home_spec.rb 619 B

123456789101112131415161718192021222324252627
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe 'Home page' do
  4. context 'when signed in' do
  5. before { sign_in Fabricate(:user) }
  6. it 'visits the homepage and renders the web app' do
  7. visit root_path
  8. expect(page)
  9. .to have_css('noscript', text: /Mastodon/)
  10. .and have_css('body', class: 'app-body')
  11. end
  12. end
  13. context 'when not signed in' do
  14. it 'visits the homepage and renders the web app' do
  15. visit root_path
  16. expect(page)
  17. .to have_css('noscript', text: /Mastodon/)
  18. .and have_css('body', class: 'app-body')
  19. end
  20. end
  21. end