-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14000 from djberg96/vm_resource_group
Add relationship between VM and ResourceGroup.
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
class ResourceGroup < ApplicationRecord | ||
has_many :vms | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
describe ResourceGroup do | ||
let(:resource_group) do | ||
FactoryGirl.create( | ||
:resource_group, | ||
:type => "ResourceGroup", | ||
:name => "foo", | ||
:ems_ref => "/subscriptions/xxx/resourceGroups/foo" | ||
) | ||
end | ||
|
||
context "properties" do | ||
it "has the expected resource group" do | ||
expect(resource_group.type).to eql("ResourceGroup") | ||
end | ||
|
||
it "has the expected name" do | ||
expect(resource_group.name).to eql("foo") | ||
end | ||
|
||
it "has the expected ems_ref" do | ||
expect(resource_group.ems_ref).to eql("/subscriptions/xxx/resourceGroups/foo") | ||
end | ||
end | ||
|
||
context "relationships" do | ||
it "has many vms" do | ||
expect(resource_group).to respond_to(:vms) | ||
end | ||
end | ||
end |