spec/acceptance/role_resource_spec.rb in ridley-0.10.2 vs spec/acceptance/role_resource_spec.rb in ridley-0.11.0.rc1

- old
+ new

@@ -2,10 +2,11 @@ describe "Role API operations", type: "acceptance" do let(:server_url) { "https://api.opscode.com/organizations/ridley" } let(:client_name) { "reset" } let(:client_key) { "/Users/reset/.chef/reset.pem" } + let(:resource) { double('role-resource') } let(:connection) do Ridley.new( server_url: server_url, client_name: client_name, @@ -18,36 +19,36 @@ before(:each) { connection.role.delete_all } describe "finding a role" do let(:target) do - Ridley::RoleResource.new( - connection, + Ridley::RoleObject.new( + resource, name: "ridley-test", description: "a testing role for ridley" ) end before(:each) do connection.role.create(target) end - it "returns the target Ridley::RoleResource from the server" do + it "returns the target Ridley::RoleObject from the server" do connection.role.find(target.name).should eql(target) end end describe "creating a role" do let(:target) do - Ridley::RoleResource.new( - connection, + Ridley::RoleObject.new( + resource, name: "ridley-test", description: "a testing role for ridley" ) end - it "returns a new Ridley::RoleResource" do + it "returns a new Ridley::RoleObject" do connection.role.create(target).should eql(target) end it "adds a new role to the server" do connection.sync do @@ -58,21 +59,21 @@ end end describe "deleting a role" do let(:target) do - Ridley::RoleResource.new( - connection, + Ridley::RoleObject.new( + resource, name: "ridley-role-one" ) end before(:each) do connection.role.create(target) end - it "returns the deleted Ridley::RoleResource resource" do + it "returns the deleted Ridley::RoleObject resource" do connection.role.delete(target).should eql(target) end it "removes the role from the server" do connection.sync do @@ -104,27 +105,27 @@ it "should return an array of Ridley::RoleResource objects" do connection.sync do obj = role.all obj.should have(2).roles - obj.should each be_a(Ridley::RoleResource) + obj.should each be_a(Ridley::RoleObject) end end end describe "updating a role" do let(:target) do - Ridley::RoleResource.new( - connection, + Ridley::RoleObject.new( + resource, name: "ridley-role-one" ) end before(:each) do connection.role.create(target) end - it "returns an updated Ridley::RoleResource object" do + it "returns an updated Ridley::RoleObject object" do connection.role.update(target).should eql(target) end it "saves a new run_list" do target.run_list = run_list = ["recipe[one]", "recipe[two]"]