Added some Content-Type unit tests
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -11,6 +11,10 @@ RSpec.describe(HardwareController) do
|
||||
expect(last_response).to(be_redirect)
|
||||
end
|
||||
|
||||
it 'Hardware base route is an HTML response' do
|
||||
expect(last_response['Content-Type']).to(include('text/html'))
|
||||
end
|
||||
|
||||
it 'Hardware base route Location header points to /hardware/list' do
|
||||
expect(last_response['Location']).to(eq("#{BASE_URL}/hardware/list"))
|
||||
end
|
||||
@@ -24,6 +28,10 @@ RSpec.describe(HardwareController) do
|
||||
expect(last_response).to(be_ok)
|
||||
end
|
||||
|
||||
it 'Hardware list page is an HTML response' do
|
||||
expect(last_response['Content-Type']).to(include('text/html'))
|
||||
end
|
||||
|
||||
it "Hardware list page contains 'List of hardware' on page." do
|
||||
expect(last_response.body).to(include('List of hardware'))
|
||||
end
|
||||
@@ -37,6 +45,10 @@ RSpec.describe(HardwareController) do
|
||||
expect(last_response).to(be_ok)
|
||||
end
|
||||
|
||||
it 'Hardware add page is an HTML response' do
|
||||
expect(last_response['Content-Type']).to(include('text/html'))
|
||||
end
|
||||
|
||||
it "Hardware add page contains 'Add new hardware' on page." do
|
||||
expect(last_response.body).to(include('Add new hardware'))
|
||||
end
|
||||
|
Reference in New Issue
Block a user