mirror of
https://github.com/mastodon/mastodon.git
synced 2026-05-02 03:17:00 -05:00
Some checks are pending
Check i18n / check-i18n (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
CodeQL / Analyze (ruby) (push) Waiting to run
Check formatting / lint (push) Waiting to run
CSS Linting / lint (push) Waiting to run
Ruby Linting / lint (push) Waiting to run
Historical data migration test / test (14-alpine) (push) Waiting to run
Historical data migration test / test (15-alpine) (push) Waiting to run
Historical data migration test / test (16-alpine) (push) Waiting to run
Historical data migration test / test (17-alpine) (push) Waiting to run
Ruby Testing / build (production) (push) Waiting to run
Ruby Testing / build (test) (push) Waiting to run
Ruby Testing / test (.ruby-version) (push) Blocked by required conditions
Ruby Testing / test (3.2) (push) Blocked by required conditions
Ruby Testing / test (3.3) (push) Blocked by required conditions
Ruby Testing / Libvips tests (.ruby-version) (push) Blocked by required conditions
Ruby Testing / Libvips tests (3.2) (push) Blocked by required conditions
Ruby Testing / Libvips tests (3.3) (push) Blocked by required conditions
Ruby Testing / End to End testing (.ruby-version) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.2) (push) Blocked by required conditions
Ruby Testing / End to End testing (3.3) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, docker.elastic.co/elasticsearch/elasticsearch:8.10.2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (.ruby-version, opensearchproject/opensearch:2) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.2, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
Ruby Testing / Elastic Search integration testing (3.3, docker.elastic.co/elasticsearch/elasticsearch:7.17.13) (push) Blocked by required conditions
54 lines
1.5 KiB
Ruby
54 lines
1.5 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe 'Account notes', :inline_jobs, :js, :streaming do
|
|
include ProfileStories
|
|
|
|
let(:email) { 'test@example.com' }
|
|
let(:password) { 'password' }
|
|
let(:confirmed_at) { Time.zone.now }
|
|
let(:finished_onboarding) { true }
|
|
|
|
let!(:other_account) { Fabricate(:account) }
|
|
|
|
before { as_a_logged_in_user }
|
|
|
|
it 'can be written and viewed' do
|
|
visit_profile(other_account)
|
|
|
|
note_text = 'This is a personal note'
|
|
fill_in 'Click to add note', with: note_text
|
|
|
|
# This is a bit awkward since there is no button to save the change
|
|
# The easiest way is to send ctrl+enter ourselves
|
|
find_field(class: 'account__header__account-note__content').send_keys [:control, :enter]
|
|
|
|
within('.account__header__account-note .inline-alert') do
|
|
expect(page)
|
|
.to have_content('SAVED')
|
|
end
|
|
|
|
expect(page)
|
|
.to have_css('.account__header__account-note__content', text: note_text)
|
|
|
|
# Navigate back and forth and ensure the comment is still here
|
|
visit root_url
|
|
visit_profile(other_account)
|
|
|
|
expect(AccountNote.find_by(account: bob.account, target_account: other_account).comment)
|
|
.to eq note_text
|
|
|
|
expect(page)
|
|
.to have_css('.account__header__account-note__content', text: note_text)
|
|
end
|
|
|
|
def visit_profile(account)
|
|
visit short_account_path(account)
|
|
|
|
expect(page)
|
|
.to have_css('div.app-holder')
|
|
.and have_css('form.compose-form')
|
|
end
|
|
end
|