Merge commit '3178acc5cb8415a72b646dbe77be05255d3966f3' into glitch-soc/merge-upstream
This commit is contained in:
commit
19fa4cfcf2
143 files changed
+741
-1289
No files matched your search
@@ -44,6 +44,8 @@ RSpec.describe 'Filters' do
|
||||
let(:new_title) { 'Change title value' }
|
||||
|
||||
let!(:custom_filter) { Fabricate :custom_filter, account: user.account, title: filter_title }
|
||||
let!(:keyword_one) { Fabricate :custom_filter_keyword, custom_filter: custom_filter }
|
||||
let!(:keyword_two) { Fabricate :custom_filter_keyword, custom_filter: custom_filter }
|
||||
|
||||
it 'Updates the saved filter' do
|
||||
navigate_to_filters
|
||||
@@ -51,7 +53,12 @@ RSpec.describe 'Filters' do
|
||||
click_on filter_title
|
||||
|
||||
fill_in filter_title_field, with: new_title
|
||||
click_on submit_button
|
||||
fill_in 'custom_filter_keywords_attributes_0_keyword', with: 'New value'
|
||||
fill_in 'custom_filter_keywords_attributes_1_keyword', with: 'Wilderness'
|
||||
|
||||
expect { click_on submit_button }
|
||||
.to change { keyword_one.reload.keyword }.to(/New value/)
|
||||
.and(change { keyword_two.reload.keyword }.to(/Wilderness/))
|
||||
|
||||
expect(page).to have_content(new_title)
|
||||
end
|
||||
|
||||
@@ -5,8 +5,6 @@ require 'rails_helper'
|
||||
RSpec.describe 'Profile' do
|
||||
include ProfileStories
|
||||
|
||||
subject { page }
|
||||
|
||||
let(:local_domain) { Rails.configuration.x.local_domain }
|
||||
|
||||
before do
|
||||
@@ -17,7 +15,8 @@ RSpec.describe 'Profile' do
|
||||
it 'I can view public account page for Alice' do
|
||||
visit account_path('alice')
|
||||
|
||||
expect(subject).to have_title("alice (@alice@#{local_domain})")
|
||||
expect(page)
|
||||
.to have_title("alice (@alice@#{local_domain})")
|
||||
end
|
||||
|
||||
it 'I can change my account' do
|
||||
@@ -26,8 +25,31 @@ RSpec.describe 'Profile' do
|
||||
fill_in 'Display name', with: 'Bob'
|
||||
fill_in 'Bio', with: 'Bob is silent'
|
||||
|
||||
first('button[type=submit]').click
|
||||
fill_in 'account_fields_attributes_0_name', with: 'Personal Website'
|
||||
fill_in 'account_fields_attributes_0_value', with: 'https://host.example/personal'
|
||||
|
||||
expect(subject).to have_content 'Changes successfully saved!'
|
||||
fill_in 'account_fields_attributes_1_name', with: 'Professional Biography'
|
||||
fill_in 'account_fields_attributes_1_value', with: 'https://host.example/pro'
|
||||
|
||||
expect { submit_form }
|
||||
.to change { bob.account.reload.display_name }.to('Bob')
|
||||
.and(change_account_fields)
|
||||
expect(page)
|
||||
.to have_content 'Changes successfully saved!'
|
||||
end
|
||||
|
||||
def submit_form
|
||||
first('button[type=submit]').click
|
||||
end
|
||||
|
||||
def change_account_fields
|
||||
change { bob.account.reload.fields }
|
||||
.from([])
|
||||
.to(
|
||||
contain_exactly(
|
||||
be_a(Account::Field),
|
||||
be_a(Account::Field)
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user