discourse/spec/views/omniauth_callbacks/failure.html.erb_spec.rb
David Taylor 750802bf56
UX: Improve error handling for common OmniAuth exceptions (#7991)
This displays more useful messages for the most common issues we see:
- CSRF (when the user switches browser)
- Invalid IAT (when the server clock is wrong)
- OAuth::Unauthorized for OAuth1 providers, when the credentials are incorrect

This commit also stops earlier for disabled authenticators. Now we stop at the request phase, rather than the callback phase.
2019-08-12 10:55:02 +01:00

15 lines
343 B
Ruby

# frozen_string_literal: true
require "rails_helper"
describe "users/omniauth_callbacks/failure.html.erb" do
it "renders the failure page" do
flash[:error] = I18n.t("login.omniauth_error", strategy: 'test')
render
expect(rendered.match(I18n.t("login.omniauth_error.generic", strategy: 'test'))).not_to eq(nil)
end
end