Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,6 @@ def stub_delete_and_return(status, body)
context 'when the service instance is shared' do
let(:service_instance) { ManagedServiceInstance.make }
let(:shared_to_space) { Space.make }
let(:shared_to_user) { make_developer_for_space(shared_to_space) }
let(:body) do
{
tags: []
Expand All @@ -1562,6 +1561,8 @@ def stub_delete_and_return(status, body)
end

context 'and a developer in the shared to space tries to update the instance' do
let(:shared_to_user) { make_developer_for_space(shared_to_space) }

before do
set_current_user(shared_to_user)
end
Expand All @@ -1574,31 +1575,6 @@ def stub_delete_and_return(status, body)
expect(last_response.body).to include 'You are not authorized to perform the requested action'
end
end

context 'and a developer in the shared_to space tries to rename a service instance' do
let(:service_instance) { ManagedServiceInstance.make(name: 'r1') }
let(:target_space_service_instance) { ManagedServiceInstance.make(name: 'r2', space: shared_to_space) }

before do
set_current_user(shared_to_user)
end

context 'when the name clashes with a shared service instance' do
let(:body) do
{
name: 'r1'
}.to_json
end

it 'should give the user an error' do
put "/v2/service_instances/#{target_space_service_instance.guid}", body

expect(last_response).to have_status_code 400
expect(last_response.body).to include 'CF-ServiceInstanceNameTaken'
expect(last_response.body).to include "The service instance name is taken: #{service_instance.name}"
end
end
end
end

describe 'error cases' do
Expand Down