-
Notifications
You must be signed in to change notification settings - Fork 900
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 #10897 from alongoldboim/provider_meta_data
Adding custom attributes to provider (UI + API) (cherry picked from commit 46277ee)
- Loading branch information
Showing
7 changed files
with
189 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
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,24 @@ | ||
describe EmsContainerHelper::TextualSummary do | ||
context "providers custom attributes" do | ||
before do | ||
@record = FactoryGirl.build(:ems_openshift) | ||
allow_any_instance_of(described_class).to receive(:role_allows?).and_return(true) | ||
allow(controller).to receive(:restful?).and_return(true) | ||
allow(controller).to receive(:controller_name).and_return("ems_container") | ||
end | ||
|
||
it "should parse custom attributes to labels and values" do | ||
@record.custom_attributes << FactoryGirl.build(:custom_attribute, | ||
:name => "Example_custom_attribute", | ||
:value => 4) | ||
|
||
expect(textual_miq_custom_attributes.first[:label]).to eq("Example custom attribute") | ||
|
||
expect(textual_miq_custom_attributes.first[:value]).to eq("4") | ||
end | ||
|
||
it "should return nil if no custom attributes" do | ||
expect(textual_miq_custom_attributes).to eq(nil) | ||
end | ||
end | ||
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