2020-01-03 03:44:06 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2023-02-18 23:59:00 +02:00
|
|
|
describe 'Profile' do
|
2020-01-03 03:44:06 +02:00
|
|
|
include ProfileStories
|
|
|
|
|
2023-02-18 23:59:00 +02:00
|
|
|
subject { page }
|
|
|
|
|
|
|
|
let(:local_domain) { ENV['LOCAL_DOMAIN'] }
|
2020-01-03 03:44:06 +02:00
|
|
|
|
2023-02-18 23:59:00 +02:00
|
|
|
before do
|
2020-01-03 03:44:06 +02:00
|
|
|
as_a_logged_in_user
|
|
|
|
with_alice_as_local_user
|
|
|
|
end
|
|
|
|
|
2023-02-18 23:59:00 +02:00
|
|
|
it 'I can view Annes public account' do
|
2020-01-03 03:44:06 +02:00
|
|
|
visit account_path('alice')
|
|
|
|
|
2023-02-20 06:00:48 +02:00
|
|
|
expect(subject).to have_title("alice (@alice@#{local_domain})")
|
2020-01-03 03:44:06 +02:00
|
|
|
end
|
|
|
|
|
2023-02-18 23:59:00 +02:00
|
|
|
it 'I can change my account' do
|
2020-01-03 03:44:06 +02:00
|
|
|
visit settings_profile_path
|
2022-10-20 15:35:29 +03:00
|
|
|
|
2020-01-03 03:44:06 +02:00
|
|
|
fill_in 'Display name', with: 'Bob'
|
|
|
|
fill_in 'Bio', with: 'Bob is silent'
|
|
|
|
|
2022-10-20 15:35:29 +03:00
|
|
|
first('button[type=submit]').click
|
2020-01-03 03:44:06 +02:00
|
|
|
|
2023-02-20 06:00:48 +02:00
|
|
|
expect(subject).to have_content 'Changes successfully saved!'
|
2020-01-03 03:44:06 +02:00
|
|
|
end
|
|
|
|
end
|