-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding detection of custom attributes field type in miq expression
- Loading branch information
1 parent
76ae3d7
commit 4687394
Showing
5 changed files
with
63 additions
and
4 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
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
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,17 @@ | ||
describe CustomAttribute do | ||
let(:string_custom_attribute) { FactoryGirl.build(:custom_attribute, :name => "foo", :value => "string", :resource_type => 'ExtManagementSystem') } | ||
let(:time_custom_attribute) { FactoryGirl.build(:custom_attribute, :name => "bar", :value => DateTime.current, :resource_type => 'ExtManagementSystem') } | ||
let(:int_custom_attribute) { FactoryGirl.build(:custom_attribute, :name => "foobar", :value => 5, :resource_type => 'ExtManagementSystem') } | ||
|
||
it "returns the value type of String custom attributes" do | ||
expect(string_custom_attribute.value_type).to eq(:string) | ||
end | ||
|
||
it "returns the value type of DateTime custom attributes" do | ||
expect(time_custom_attribute.value_type).to eq(:datetime) | ||
end | ||
|
||
it "returns the value type of Fixnum custom attributes" do | ||
expect(int_custom_attribute.value_type).to eq(:fixnum) | ||
end | ||
end |