Browse Source

Correct class name

pull/263/head
Stéphane Meny 3 years ago
parent
commit
c1d6587e81
No known key found for this signature in database
GPG Key ID: 9D0AFEA988527923
  1. 10
      spec/services/storage_service_spec.rb

10
spec/services/storage_service_spec.rb

@ -1,6 +1,6 @@
require "rails_helper" require "rails_helper"
RSpec.describe "S3Service" do RSpec.describe StorageService do
let(:instance_name) { "instance_1" } let(:instance_name) { "instance_1" }
let(:bucket_name) { "bucket_1" } let(:bucket_name) { "bucket_1" }
let(:vcap_services) do let(:vcap_services) do
@ -20,14 +20,14 @@ RSpec.describe "S3Service" do
end end
context "when we create an S3 Service with no PaaS Configuration present" do context "when we create an S3 Service with no PaaS Configuration present" do
subject { StorageService.new(PaasConfigurationService.new, "random_instance") } subject { described_class.new(PaasConfigurationService.new, "random_instance") }
it "raises an exception" do it "raises an exception" do
expect { subject }.to raise_error(RuntimeError, /No PaaS configuration present/) expect { subject }.to raise_error(RuntimeError, /No PaaS configuration present/)
end end
end end
context "when we create an S3 Service with an unknown instance name" do context "when we create an S3 Service with an unknown instance name" do
subject { StorageService.new(PaasConfigurationService.new, "random_instance") } subject { described_class.new(PaasConfigurationService.new, "random_instance") }
before do before do
allow(ENV).to receive(:[]).with("VCAP_SERVICES").and_return("{}") allow(ENV).to receive(:[]).with("VCAP_SERVICES").and_return("{}")
end end
@ -38,7 +38,7 @@ RSpec.describe "S3Service" do
end end
context "when we create an storage service with a valid instance name" do context "when we create an storage service with a valid instance name" do
subject { StorageService.new(PaasConfigurationService.new, instance_name) } subject { described_class.new(PaasConfigurationService.new, instance_name) }
before do before do
allow(ENV).to receive(:[]) allow(ENV).to receive(:[])
@ -63,7 +63,7 @@ RSpec.describe "S3Service" do
end end
context "when we create an storage service and write a stubbed object" do context "when we create an storage service and write a stubbed object" do
subject { StorageService.new(PaasConfigurationService.new, instance_name) } subject { described_class.new(PaasConfigurationService.new, instance_name) }
let(:filename) { "my_file" } let(:filename) { "my_file" }
let(:content) { "content" } let(:content) { "content" }
let(:s3_client_stub) { Aws::S3::Client.new(stub_responses: true) } let(:s3_client_stub) { Aws::S3::Client.new(stub_responses: true) }

Loading…
Cancel
Save