-
Notifications
You must be signed in to change notification settings - Fork 900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new firmware collection api #14476
Changes from 4 commits
36bf074
7f6e6b1
7036b6e
e7b1458
f422f71
6266155
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Api | ||
class FirmwaresController < BaseController | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FactoryGirl.define do | ||
factory :firmware do | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
RSpec.describe "firmwares API" do | ||
describe "display firmware details" do | ||
context "with a valid role" do | ||
it "shows its properties" do | ||
fw = FactoryGirl.create(:firmware, :id => 1, :name => "UEFI", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You probably don't want to set the |
||
:version => "D7E152CUS-2.11", :resource_id => 1) | ||
|
||
api_basic_authorize action_identifier(:firmwares, :read, :resource_actions, :get) | ||
|
||
run_get(firmwares_url(fw.id)) | ||
|
||
expect_single_resource_query("id" => 1, | ||
"name" => "UEFI", | ||
"version" => "D7E152CUS-2.11", | ||
"resource_id" => 1) | ||
end | ||
end | ||
|
||
context "with an invalid role" do | ||
it "fails to show its properties" do | ||
fw = FactoryGirl.create(:firmware, :id => 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above |
||
|
||
api_basic_authorize | ||
|
||
run_get(firmwares_url(fw.id)) | ||
|
||
expect(response).to have_http_status(:forbidden) | ||
end | ||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add test for invalid role and such. |
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which primary collection is declaring this as a subcollection ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the PhysicalServer collection. The PhysicalServer collection is defined in PR #14028.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodneyhbrown7 it looks like in the linked PR it's not declaring this as a subcollection. It may be best to leave this out in this PR, or until you are ready to add it to the phyical server config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abellotti @imtayadeway @rodneyhbrown7 I removed the firmwares subcollection option for now. If this PR gets merged before the linked PR (#14028), the linked PR will be updated to add this as a subcollection.