2020-01-03 10:44:06 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-09-04 14:12:25 +09:00
|
|
|
RSpec.describe 'Profile' do
|
2020-01-03 10:44:06 +09:00
|
|
|
include ProfileStories
|
|
|
|
|
2023-02-19 06:59:00 +09:00
|
|
|
subject { page }
|
|
|
|
|
2024-06-03 18:15:58 +09:00
|
|
|
let(:local_domain) { Rails.configuration.x.local_domain }
|
2020-01-03 10:44:06 +09:00
|
|
|
|
2023-02-19 06:59:00 +09:00
|
|
|
before do
|
2020-01-03 10:44:06 +09:00
|
|
|
as_a_logged_in_user
|
2024-10-23 22:31:03 +09:00
|
|
|
Fabricate(:user, account: Fabricate(:account, username: 'alice'))
|
2020-01-03 10:44:06 +09:00
|
|
|
end
|
|
|
|
|
2024-10-23 22:31:03 +09:00
|
|
|
it 'I can view public account page for Alice' do
|
2020-01-03 10:44:06 +09:00
|
|
|
visit account_path('alice')
|
|
|
|
|
2023-02-20 13:00:48 +09:00
|
|
|
expect(subject).to have_title("alice (@alice@#{local_domain})")
|
2020-01-03 10:44:06 +09:00
|
|
|
end
|
|
|
|
|
2023-02-19 06:59:00 +09:00
|
|
|
it 'I can change my account' do
|
2020-01-03 10:44:06 +09:00
|
|
|
visit settings_profile_path
|
2022-10-20 21:35:29 +09:00
|
|
|
|
2020-01-03 10:44:06 +09:00
|
|
|
fill_in 'Display name', with: 'Bob'
|
|
|
|
fill_in 'Bio', with: 'Bob is silent'
|
|
|
|
|
2022-10-20 21:35:29 +09:00
|
|
|
first('button[type=submit]').click
|
2020-01-03 10:44:06 +09:00
|
|
|
|
2023-02-20 13:00:48 +09:00
|
|
|
expect(subject).to have_content 'Changes successfully saved!'
|
2020-01-03 10:44:06 +09:00
|
|
|
end
|
|
|
|
end
|