add base feature specs

This commit is contained in:
Alex Turchyn
2023-08-20 12:42:47 +03:00
parent 6b4e7c2264
commit cbc6f4497a
32 changed files with 1134 additions and 12 deletions
+31
View File
@@ -0,0 +1,31 @@
# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Webhook Settings' do
let!(:account) { create(:account) }
let!(:user) { create(:user, account:) }
before do
sign_in(user)
visit settings_webhooks_path
end
it 'shows webhook settings page' do
expect(page).to have_content('Webhooks')
expect(page).to have_field('Webhook URL')
expect(page).to have_button('Save')
end
it 'updates the webhook URL' do
fill_in 'Webhook URL', with: 'https://example.com'
expect do
click_button 'Save'
end.to change(EncryptedConfig, :count).by(1)
encrypted_config = EncryptedConfig.find_by(account:, key: EncryptedConfig::WEBHOOK_URL_KEY)
expect(encrypted_config.value).to eq('https://example.com')
end
end