1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/spec/requests/staff/people/account_connection_links/show_spec.rb

35 lines
790 B
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'GET /staff/people/:person_id/account_connection_link' do
let(:person) { create :initial_person }
let(:current_account) { create :superuser_account }
before do
sign_in current_account.user if current_account&.user
get "/staff/people/#{person.to_param}/account_connection_link"
end
for_account_types nil, :usual do
specify do
expect(response).to have_http_status :forbidden
end
end
for_account_types :superuser do
specify do
expect(response).to have_http_status :ok
end
end
context 'when person already has account' do
let(:person) { create(:personal_account).person }
specify do
expect(response).to have_http_status :forbidden
end
end
end