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 #2239 from bgeuken/api_test_
Api tests for orderkiwirepos
- Loading branch information
Showing
4 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
...T_global_command_orderkiwirepos/is_accessible_anonymously_and_forwards_backend_errors.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,27 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe SourceController, vcr: true do | ||
describe "POST #global_command_orderkiwirepos" do | ||
it "is accessible anonymously and forwards backend errors" do | ||
post :global_command_orderkiwirepos, params: { cmd: "orderkiwirepos" } | ||
expect(response).to have_http_status(:bad_request) | ||
expect(Xmlhash.parse(response.body)["summary"]).to eq("read_file: no content attached") | ||
end | ||
end | ||
|
||
describe "POST #global_command_branch" do | ||
it "is not accessible anonymously" do | ||
post :global_command_branch, params: { cmd: "branch" } | ||
expect(flash[:error]).to eq("anonymous_user(Anonymous user is not allowed here - please login): ") | ||
expect(response).to redirect_to(root_path) | ||
end | ||
end | ||
|
||
describe "POST #global_command_createmaintenanceincident" do | ||
it "is not accessible anonymously" do | ||
post :global_command_createmaintenanceincident, params: { cmd: "createmaintenanceincident" } | ||
expect(flash[:error]).to eq("anonymous_user(Anonymous user is not allowed here - please login): ") | ||
expect(response).to redirect_to(root_path) | ||
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
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