mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-11 06:20:42 +00:00
Add wrapstodon page spec (#37168)
This commit is contained in:
19
spec/requests/wrapstodon_spec.rb
Normal file
19
spec/requests/wrapstodon_spec.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Wrapstodon' do
|
||||
let(:generated_annual_report) { AnnualReport.new(user.account, Time.current.year).generate }
|
||||
let(:user) { Fabricate :user }
|
||||
|
||||
describe 'GET /@:account_username/wrapstodon/:year/:share_key' do
|
||||
context 'when share_key is invalid' do
|
||||
it 'returns not found' do
|
||||
get public_wrapstodon_path(account_username: user.account.username, year: generated_annual_report.year, share_key: 'sharks')
|
||||
|
||||
expect(response)
|
||||
.to have_http_status(404)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
22
spec/system/wrapstodon_spec.rb
Normal file
22
spec/system/wrapstodon_spec.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'Wrapstodon' do
|
||||
describe 'Viewing a wrapstodon' do
|
||||
let(:generated_annual_report) { AnnualReport.new(user.account, Time.current.year).generate }
|
||||
let(:user) { Fabricate :user }
|
||||
|
||||
context 'when signed in' do
|
||||
before { sign_in user }
|
||||
|
||||
it 'visits the wrap page and renders the web app' do
|
||||
visit public_wrapstodon_path(account_username: user.account.username, year: generated_annual_report.year, share_key: generated_annual_report.share_key)
|
||||
|
||||
expect(page)
|
||||
.to have_css('#wrapstodon')
|
||||
.and have_private_cache_control
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user