Skip to content

Commit

Permalink
Refactor request tests for service brokers
Browse files Browse the repository at this point in the history
Instead of slicing the tests on user permissions, we are now
slicing it on endpoints

[#166631760]

Co-authored-by: Derik Evangelista <[email protected]>
Co-authored-by: Oleksii Fedorov <[email protected]>
Co-authored-by: Winna Bridgewater <[email protected]>
  • Loading branch information
4 people authored and FelisiaM committed Sep 3, 2019
1 parent b50aecc commit fcebddc
Show file tree
Hide file tree
Showing 7 changed files with 437 additions and 561 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ group :development do
gem 'solargraph'
gem 'spork', git: 'https://github.com/sporkrb/spork', ref: '224df49' # '~> 1.0rc'
gem 'spring'
gem 'spring-commands-rspec'
end
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ GEM
tilt (~> 2.0)
yard (~> 0.9)
spring (2.1.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
statsd-ruby (1.4.0)
steno (1.3.4)
fluent-logger
Expand Down Expand Up @@ -527,6 +529,7 @@ DEPENDENCIES
solargraph
spork!
spring
spring-commands-rspec
statsd-ruby (~> 1.4.0)
steno
talentbox-delayed_job_sequel (~> 4.3.0)
Expand Down
5 changes: 5 additions & 0 deletions app/controllers/v3/service_brokers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def create
unprocessable!(e.message)
end

def delete
raise "real,ly unique mesage with stypos"
#render status: :ok, json: {}
end

private

def broker_not_found!
Expand Down
8 changes: 8 additions & 0 deletions bin/rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
get '/service_brokers', to: 'service_brokers#index'
get '/service_brokers/:guid', to: 'service_brokers#show'
post '/service_brokers', to: 'service_brokers#create'
delete '/service_brokers/:guid', to: 'service_brokers#delete'

# space_manifests
post '/spaces/:guid/actions/apply_manifest', to: 'space_manifests#apply_manifest'
Expand Down
Loading

0 comments on commit fcebddc

Please sign in to comment.