This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge pull request #1094 from fastlane/fixes-1084

fix broken specs #1084
  • Loading branch information...
KrauseFx committed Jul 26, 2018
2 parents bf13bd0 + d172a79 commit ddb16c796a612e65f8ae5b00d688221fcc3b1687
Showing with 15 additions and 15 deletions.
  1. +15 −15 spec/features-json/api_controller_spec.rb
@@ -137,26 +137,26 @@ class MyMixedAuthApiController < FastlaneCI::APIController
end
describe "jwt authentication" do
before do
app.helpers.response = Sinatra::Response.new
end
it "will successfully decode a token" do
payload = app.helpers.authenticate!(via: :jwt)
expect(payload).to include("iss", "sub", "user", "iat")
end
# TODO: These tests need to be fixed, as they broke with https://github.com/fastlane/ci/pull/1004
# @KrauseFx couldn't figure out how to properly stub those methods, we're waiting for @snatchev to come
# back and help out
#
# it "will halt with an error if the token is not valid" do
# app.helpers.request = Sinatra::Request.new(Rack::MockRequest.env_for("/", { "HTTP_AUTHORIZATION" => "Bearer something-else" }))
# expect do
# app.helpers.authenticate!(via: :jwt)
# end.to throw_symbol(:halt)
# app.helpers.request = Sinatra::Request.new(Rack::MockRequest.env_for("/", {}))
# expect do
# app.helpers.authenticate!(via: :jwt)
# end.to throw_symbol(:halt)
# end
it "will halt with an error if the token is not valid" do
app.helpers.request = Sinatra::Request.new(Rack::MockRequest.env_for("/", { "HTTP_AUTHORIZATION" => "Bearer something-else" }))
expect do
app.helpers.authenticate!(via: :jwt)
end.to throw_symbol(:halt)
app.helpers.request = Sinatra::Request.new(Rack::MockRequest.env_for("/", {}))
expect do
app.helpers.authenticate!(via: :jwt)
end.to throw_symbol(:halt)
end
end
describe "user authentication methods" do

0 comments on commit ddb16c7

Please sign in to comment.