Skip to content

Commit 2e460c8

Browse files
committed
Make name optional when updating an Organization
1 parent ae64c0e commit 2e460c8

File tree

3 files changed

+101
-2
lines changed

3 files changed

+101
-2
lines changed

lib/workos/organizations.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def update_organization(
131131
organization:,
132132
domain_data: nil,
133133
domains: nil,
134-
name:,
134+
name: nil,
135135
allow_profiles_outside_organization: nil
136136
)
137137
body = { name: name }

spec/lib/workos/organizations_spec.rb

+15-1
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,28 @@
267267

268268
describe '.update_organization' do
269269
context 'with valid payload' do
270-
it 'creates an organization' do
270+
it 'updates the organization' do
271271
VCR.use_cassette 'organization/update' do
272272
organization = described_class.update_organization(
273273
organization: 'org_01F6Q6TFP7RD2PF6J03ANNWDKV',
274274
domains: ['example.me'],
275275
name: 'Test Organization',
276276
)
277277

278+
expect(organization.id).to eq('org_01F6Q6TFP7RD2PF6J03ANNWDKV')
279+
expect(organization.name).to eq('Test Organization')
280+
expect(organization.domains.first[:domain]).to eq('example.me')
281+
end
282+
end
283+
end
284+
context 'without a name' do
285+
it 'updates the organization' do
286+
VCR.use_cassette 'organization/update_without_name' do
287+
organization = described_class.update_organization(
288+
organization: 'org_01F6Q6TFP7RD2PF6J03ANNWDKV',
289+
domains: ['example.me'],
290+
)
291+
278292
expect(organization.id).to eq('org_01F6Q6TFP7RD2PF6J03ANNWDKV')
279293
expect(organization.name).to eq('Test Organization')
280294
expect(organization.domains.first[:domain]).to eq('example.me')

spec/support/fixtures/vcr_cassettes/organization/update_without_name.yml

+85
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)