0
0
Fork 0

Convert "static page" controller specs to system specs (#31599)

This commit is contained in:
Matt Jankowski 2024-08-26 11:53:48 -04:00 committed by GitHub
parent 963c1309a4
commit 4c2534d12e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 49 additions and 61 deletions

12
spec/system/about_spec.rb Normal file
View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
require 'rails_helper'
describe 'About page' do
it 'visits the about page and renders the web app' do
visit about_path
expect(page)
.to have_css('noscript', text: /Mastodon/)
end
end

25
spec/system/home_spec.rb Normal file
View file

@ -0,0 +1,25 @@
# frozen_string_literal: true
require 'rails_helper'
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/)
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/)
end
end
end

View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
require 'rails_helper'
describe 'Privacy policy page' do
it 'visits the privacy policy page and renders the web app' do
visit privacy_policy_path
expect(page)
.to have_css('noscript', text: /Mastodon/)
end
end