Skip to content

Commit 0f14026

Browse files
authored
Make name optional when updating an Organization (#319)
* Make name optional when updating an Organization * cleanup * 5.4.0
1 parent ae64c0e commit 0f14026

File tree

5 files changed

+103
-4
lines changed

5 files changed

+103
-4
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
workos (5.3.0)
4+
workos (5.4.0)
55

66
GEM
77
remote: https://rubygems.org/

lib/workos/organizations.rb

Lines changed: 1 addition & 1 deletion
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 }

lib/workos/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module WorkOS
4-
VERSION = '5.3.0'
4+
VERSION = '5.4.0'
55
end

spec/lib/workos/organizations_spec.rb

Lines changed: 15 additions & 1 deletion
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

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)