profile_spec.rb 727 B

123456789101112131415161718192021222324252627282930313233
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe 'Profile' do
  4. include ProfileStories
  5. subject { page }
  6. let(:local_domain) { Rails.configuration.x.local_domain }
  7. before do
  8. as_a_logged_in_user
  9. Fabricate(:user, account: Fabricate(:account, username: 'alice'))
  10. end
  11. it 'I can view public account page for Alice' do
  12. visit account_path('alice')
  13. expect(subject).to have_title("alice (@alice@#{local_domain})")
  14. end
  15. it 'I can change my account' do
  16. visit settings_profile_path
  17. fill_in 'Display name', with: 'Bob'
  18. fill_in 'Bio', with: 'Bob is silent'
  19. first('button[type=submit]').click
  20. expect(subject).to have_content 'Changes successfully saved!'
  21. end
  22. end