CARVIEW |
Select Language
HTTP/2 302
date: Thu, 31 Jul 2025 02:34:50 GMT
content-type: text/html; charset=utf-8
content-length: 0
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
location: https://gist.github.com/oestrich/3746709
cache-control: no-cache
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
set-cookie: _gh_sess=D2%2BKXktnePv0rykkdzKEqpAdKw7hajEoFw%2BrcPmxvpuNDbye3yF2ErWmWdxHIHjAFHIPkz1%2F7Vpp%2FYXkJUO7QnK6G0OPPkgU2uzN7vykvxr4dsxTD8tNx2eswL5e0f%2BeNW62IdHCUXWxtapbSN098R6%2FsqAJ5yDtTTN2Z3GE0sWSrolKeBs0PmFk3aWzwafCpN1X%2BKXLGUynABnA9NSYM9tabIS5gUdxRaK6rXdQtHXamoG8uAXxbcdGTUkQeNEEqDhglBtAdDQuKoVDcTBofg%3D%3D--mo9jk%2FuEqxizbanb--4hZ4yFI6KjLS0LVy4kgSzQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1367423510.1753929289; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 02:34:49 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 02:34:49 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 945C:1BF8B1:17D32D:23A90D:688AD649
HTTP/2 200
date: Thu, 31 Jul 2025 02:34:50 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"985dd1a110f1a0c89db237997efeb5b0"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
x-github-request-id: 945C:1BF8B1:17D349:23A940:688AD649
Failing OAuth2 feature for rspec_api_documentation pr #51 · GitHub
Show Gist options
Save oestrich/3746709 to your computer and use it in GitHub Desktop.
{{ message }}
Instantly share code, notes, and snippets.
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
Save oestrich/3746709 to your computer and use it in GitHub Desktop.
Failing OAuth2 feature for rspec_api_documentation pr #51
This file contains hidden or 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
Feature: Use OAuth2 MAC client as a test client | |
Background: | |
Given a file named "app_spec.rb" with: | |
""" | |
require "rspec_api_documentation" | |
require "rspec_api_documentation/dsl" | |
require "rack/builder" | |
RspecApiDocumentation.configure do |config| | |
config.app = Rack::Builder.new do | |
map "/oauth2/token" do | |
app = lambda do |env| | |
headers = {"Pragma"=>"no-cache", "Content-Type"=>"application/json", "Content-Length"=>"274", "Cache-Control"=>"no-store"} | |
body = ["{\"mac_algorithm\":\"hmac-sha-256\",\"expires_in\":29,\"access_token\":\"HfIBIMe/hxNKSMogD33OJmLN+i9x3d2iM7WLzrN1RQvINOFz+QT8hiMiY+avbp2mc8IpzrxoupHyy0DeKuB05Q==\",\"token_type\":\"mac\",\"mac_key\":\"jb59zUztvDIC0AeaNZz+BptWvmFd4C41JyZS1DfWqKCkZTErxSMfkdjkePUcpE9/joqFt0ELyV/oIsFAf0V1ew==\"}"] | |
[200, headers, body] | |
end | |
run app | |
end | |
map "/" do | |
app = lambda do |env| | |
if env["HTTP_AUTHORIZATION"].blank? | |
return [401, {"Content-Type" => "text/plain"}, [""]] | |
end | |
request = Rack::Request.new(env) | |
response = Rack::Response.new | |
response["Content-Type"] = "text/plain" | |
response.write("hello #{request.params["target"]}") | |
response.finish | |
end | |
run app | |
end | |
map "/multiple" do | |
app = lambda do |env| | |
if env["HTTP_AUTHORIZATION"].blank? | |
return [401, {"Content-Type" => "text/plain"}, [""]] | |
end | |
request = Rack::Request.new(env) | |
response = Rack::Response.new | |
response["Content-Type"] = "text/plain" | |
response.write("hello #{request.params["targets"].join(", ")}") | |
response.finish | |
end | |
run app | |
end | |
end | |
end | |
resource "Greetings" do | |
let(:client) { RspecApiDocumentation::OAuth2MACClient.new(self, {:identifier => "1", :secret => "secret"}) } | |
get "/" do | |
parameter :target, "The thing you want to greet" | |
example "Greeting your favorite gem" do | |
do_request :target => "rspec_api_documentation" | |
response_headers["Content-Type"].should eq("text/plain") | |
status.should eq(200) | |
response_body.should eq('hello rspec_api_documentation') | |
end | |
end | |
get "/multiple" do | |
parameter :targets, "The people you want to greet" | |
let(:targets) { ["eric", "sam"] } | |
example "Greeting your favorite people" do | |
do_request | |
response_headers["Content-Type"].should eq("text/plain") | |
status.should eq(200) | |
response_body.should eq("hello eric, sam") | |
end | |
end | |
end | |
""" | |
When I run `rspec app_spec.rb --format RspecApiDocumentation::ApiFormatter` | |
Scenario: Output should contain | |
Then the output should contain: | |
""" | |
Generating API Docs | |
Greetings | |
GET / | |
* Greeting your favorite gem | |
""" | |
And the output should contain "1 example, 0 failures" | |
And the exit status should be 0 |
This file contains hidden or 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
Feature: Use OAuth2 MAC client as a test client | |
Background: # features/oauth2_mac_client.feature:2 | |
Given a file named "app_spec.rb" with: # aruba-0.4.11/lib/aruba/cucumber.rb:15 | |
""" | |
require "rspec_api_documentation" | |
require "rspec_api_documentation/dsl" | |
require "rack/builder" | |
RspecApiDocumentation.configure do |config| | |
config.app = Rack::Builder.new do | |
map "/oauth2/token" do | |
app = lambda do |env| | |
headers = {"Pragma"=>"no-cache", "Content-Type"=>"application/json", "Content-Length"=>"274", "Cache-Control"=>"no-store"} | |
body = ["{\"mac_algorithm\":\"hmac-sha-256\",\"expires_in\":29,\"access_token\":\"HfIBIMe/hxNKSMogD33OJmLN+i9x3d2iM7WLzrN1RQvINOFz+QT8hiMiY+avbp2mc8IpzrxoupHyy0DeKuB05Q==\",\"token_type\":\"mac\",\"mac_key\":\"jb59zUztvDIC0AeaNZz+BptWvmFd4C41JyZS1DfWqKCkZTErxSMfkdjkePUcpE9/joqFt0ELyV/oIsFAf0V1ew==\"}"] | |
[200, headers, body] | |
end | |
run app | |
end | |
map "/" do | |
app = lambda do |env| | |
if env["HTTP_AUTHORIZATION"].blank? | |
return [401, {"Content-Type" => "text/plain"}, [""]] | |
end | |
request = Rack::Request.new(env) | |
response = Rack::Response.new | |
response["Content-Type"] = "text/plain" | |
response.write("hello #{request.params["target"]}") | |
response.finish | |
end | |
run app | |
end | |
map "/multiple" do | |
app = lambda do |env| | |
if env["HTTP_AUTHORIZATION"].blank? | |
return [401, {"Content-Type" => "text/plain"}, [""]] | |
end | |
request = Rack::Request.new(env) | |
response = Rack::Response.new | |
response["Content-Type"] = "text/plain" | |
response.write("hello #{request.params["targets"].join(", ")}") | |
response.finish | |
end | |
run app | |
end | |
end | |
end | |
resource "Greetings" do | |
let(:client) { RspecApiDocumentation::OAuth2MACClient.new(self, {:identifier => "1", :secret => "secret"}) } | |
get "/" do | |
parameter :target, "The thing you want to greet" | |
example "Greeting your favorite gem" do | |
do_request :target => "rspec_api_documentation" | |
response_headers["Content-Type"].should eq("text/plain") | |
status.should eq(200) | |
response_body.should eq('hello rspec_api_documentation') | |
end | |
end | |
get "/multiple" do | |
parameter :targets, "The people you want to greet" | |
let(:targets) { ["eric", "sam"] } | |
example "Greeting your favorite people" do | |
do_request | |
response_headers["Content-Type"].should eq("text/plain") | |
status.should eq(200) | |
response_body.should eq("hello eric, sam") | |
end | |
end | |
end | |
""" | |
When I run `rspec app_spec.rb --format RspecApiDocumentation::ApiFormatter` # aruba-0.4.11/lib/aruba/cucumber.rb:56 | |
Scenario: Output should contain # features/oauth2_mac_client.feature:87 | |
Then the output should contain: # aruba-0.4.11/lib/aruba/cucumber.rb:98 | |
""" | |
Generating API Docs | |
Greetings | |
GET / | |
* Greeting your favorite gem | |
""" | |
And the output should contain "1 example, 0 failures" # aruba-0.4.11/lib/aruba/cucumber.rb:82 | |
expected "Generating API Docs\n Greetings\n GET /\n * Greeting your favorite gem\n GET /multiple\n ! Greeting your favorite people (FAILED)\n\nFailures:\n\n 1) Greetings GET /multiple Greeting your favorite people\n Failure/Error: response.write(\"hello \#{request.params[\"targets\"].join(\", \")}\")\n NoMethodError:\n undefined method `join' for {\"0\"=>\"eric\", \"1\"=>\"sam\"}:Hash\n # ./app_spec.rb:42:in `block (4 levels) in <top (required)>'\n # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/oauth2_mac_client.rb:52:in `call'\n # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/oauth2_mac_client.rb:46:in `do_request'\n # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/client_base.rb:31:in `process'\n # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/client_base.rb:9:in `get'\n # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/dsl/endpoint.rb:47:in `do_request'\n # ./app_spec.rb:72:in `block (3 levels) in <top (required)>'\n\nFinished in 0.3437 seconds\n2 examples, 1 failure\n\nFailed examples:\n\nrspec ./app_spec.rb:71 # Greetings GET /multiple Greeting your favorite people\n" to include "1 example, 0 failures" | |
Diff: | |
@@ -1,2 +1,28 @@ | |
-1 example, 0 failures | |
+Generating API Docs | |
+ Greetings | |
+ GET / | |
+ * Greeting your favorite gem | |
+ GET /multiple | |
+ ! Greeting your favorite people (FAILED) | |
+ | |
+Failures: | |
+ | |
+ 1) Greetings GET /multiple Greeting your favorite people | |
+ Failure/Error: response.write("hello #{request.params["targets"].join(", ")}") | |
+ NoMethodError: | |
+ undefined method `join' for {"0"=>"eric", "1"=>"sam"}:Hash | |
+ # ./app_spec.rb:42:in `block (4 levels) in <top (required)>' | |
+ # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/oauth2_mac_client.rb:52:in `call' | |
+ # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/oauth2_mac_client.rb:46:in `do_request' | |
+ # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/client_base.rb:31:in `process' | |
+ # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/client_base.rb:9:in `get' | |
+ # /Users/eric/prog/src/rspec_api_documentation/lib/rspec_api_documentation/dsl/endpoint.rb:47:in `do_request' | |
+ # ./app_spec.rb:72:in `block (3 levels) in <top (required)>' | |
+ | |
+Finished in 0.3437 seconds | |
+2 examples, 1 failure | |
+ | |
+Failed examples: | |
+ | |
+rspec ./app_spec.rb:71 # Greetings GET /multiple Greeting your favorite people | |
(RSpec::Expectations::ExpectationNotMetError) | |
features/oauth2_mac_client.feature:95:in `And the output should contain "1 example, 0 failures"' | |
And the exit status should be 0 # aruba-0.4.11/lib/aruba/cucumber.rb:126 | |
Failing Scenarios: | |
cucumber features/oauth2_mac_client.feature:87 # Scenario: Output should contain | |
1 scenario (1 failed) | |
5 steps (1 failed, 1 skipped, 3 passed) | |
0m0.931s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can’t perform that action at this time.