spec/acceptance/environment_resource_spec.rb in ridley-0.7.0.beta vs spec/acceptance/environment_resource_spec.rb in ridley-0.7.0.rc1
- old
+ new
@@ -1,19 +1,17 @@
require 'spec_helper'
describe "Environment API operations", type: "acceptance" do
- let(:server_url) { "https://api.opscode.com" }
+ let(:server_url) { "https://api.opscode.com/organizations/ridley" }
let(:client_name) { "reset" }
let(:client_key) { "/Users/reset/.chef/reset.pem" }
- let(:organization) { "ridley" }
let(:connection) do
- Ridley.connection(
+ Ridley.new(
server_url: server_url,
client_name: client_name,
- client_key: client_key,
- organization: organization
+ client_key: client_key
)
end
before(:all) { WebMock.allow_net_connect! }
after(:all) { WebMock.disable_net_connect! }
@@ -22,44 +20,44 @@
connection.environment.delete_all
end
describe "finding an environment" do
let(:target) do
- Ridley::Environment.new(
+ Ridley::EnvironmentResource.new(
connection,
name: "ridley-test-env"
)
end
before(:each) do
connection.environment.create(target)
end
- it "returns a valid Ridley::Environment object" do
+ it "returns a valid Ridley::EnvironmentResource object" do
connection.sync do
obj = environment.find(target)
- obj.should be_a(Ridley::Environment)
+ obj.should be_a(Ridley::EnvironmentResource)
obj.should be_valid
end
end
end
describe "creating an environment" do
let(:target) do
- Ridley::Environment.new(
+ Ridley::EnvironmentResource.new(
connection,
name: "ridley-test-env",
description: "a testing environment for ridley"
)
end
- it "returns a valid Ridley::Environment object" do
+ it "returns a valid Ridley::EnvironmentResource object" do
connection.sync do
obj = environment.create(target)
- obj.should be_a(Ridley::Environment)
+ obj.should be_a(Ridley::EnvironmentResource)
obj.should be_valid
end
end
end
@@ -77,12 +75,12 @@
environment.create(name: "ridley-one")
environment.create(name: "ridley-two")
end
end
- it "returns an array of Ridley::Environment objects" do
- connection.environment.delete_all.should each be_a(Ridley::Environment)
+ it "returns an array of Ridley::EnvironmentResource objects" do
+ connection.environment.delete_all.should each be_a(Ridley::EnvironmentResource)
end
it "deletes all environments but '_default' from the remote" do
connection.sync do
environment.delete_all
@@ -92,17 +90,17 @@
end
end
end
describe "listing all environments" do
- it "should return an array of Ridley::Environment objects" do
- connection.environment.all.should each be_a(Ridley::Environment)
+ it "should return an array of Ridley::EnvironmentResource objects" do
+ connection.environment.all.should each be_a(Ridley::EnvironmentResource)
end
end
describe "updating an environment" do
let(:target) do
- Ridley::Environment.new(
+ Ridley::EnvironmentResource.new(
connection,
name: "ridley-env-test"
)
end