fixes for api test docs
parent
edff93a66d
commit
6ba8d6612d
|
@ -10,13 +10,17 @@ describe DashboardController do
|
|||
expect(response.status).to eq(200)
|
||||
end
|
||||
|
||||
it "renders the terms of service" do
|
||||
it "renders the front page" do
|
||||
get :front_page
|
||||
expect(response.status).to eq(200)
|
||||
# first entry in api_docs.md
|
||||
SmarfDoc.note("Documentation generated for the " +
|
||||
"[FarmBot Web App](https://github.com/FarmBot/Farmbot-Web-App).")
|
||||
end
|
||||
|
||||
it "renders the terms of service" do
|
||||
expect { get :main_app, params: { path: "nope.jpg" } }.to raise_error(ActionController::RoutingError)
|
||||
it "returns error on invalid path" do
|
||||
expect { get :main_app, params: { path: "nope.jpg" } }
|
||||
.to raise_error(ActionController::RoutingError)
|
||||
end
|
||||
|
||||
it "receives CSP violation reports (malformed JSON)" do
|
||||
|
@ -26,7 +30,7 @@ describe DashboardController do
|
|||
expect(json).to eq(problem: "Crashed while parsing report")
|
||||
end
|
||||
|
||||
it "receives CSP violation reports (malformed JSON)" do
|
||||
it "receives CSP violation reports (JSON)" do
|
||||
post :csp_reports, body: {}.to_json, params: { format: :json }
|
||||
expect(json).to eq({})
|
||||
end
|
||||
|
|
|
@ -83,7 +83,9 @@ RSpec.configure do |config|
|
|||
config.order = "random"
|
||||
if ENV["DOCS"]
|
||||
config.after(:each, type: :controller) do
|
||||
SmarfDoc.run!(NiceResponse.new(request), response)
|
||||
if request.path.length > 0 || response.body.length > 0
|
||||
SmarfDoc.run!(NiceResponse.new(request), response)
|
||||
end
|
||||
end
|
||||
|
||||
config.after(:suite) do
|
||||
|
|
Loading…
Reference in New Issue