-
Notifications
You must be signed in to change notification settings - Fork 166
Rails 6 #4466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 6 #4466
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,14 @@ module Upaya | |
| class Application < Rails::Application | ||
| AppConfig.setup(YAML.safe_load(File.read(Rails.root.join('config', 'application.yml')))) | ||
|
|
||
| config.load_defaults '5.2' | ||
| config.load_defaults '6.0' | ||
| config.active_record.belongs_to_required_by_default = false | ||
| config.assets.unknown_asset_fallback = true | ||
|
|
||
| # We can enable this once we know we're not rolling back from Rails 6 | ||
| # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#purpose-in-signed-or-encrypted-cookie-is-now-embedded-within-cookies | ||
| config.action_dispatch.use_cookies_with_metadata = false | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this configuration is forward compatible, but not backward compatible. Once we confirm we are not rolling back to Rails 5.2, we can remove this line. |
||
|
|
||
| config.active_job.queue_adapter = 'inline' | ||
| config.time_zone = 'UTC' | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <title>We're sorry, but something went wrong (406)</title> | ||
| <meta name="viewport" content="width=device-width,initial-scale=1"> | ||
| <link rel="stylesheet" href="/css/static.css"> | ||
| </head> | ||
| <body> | ||
| <div class="site-wrapper"> | ||
| <div class="site-wrapper-inner"> | ||
| <div class="cover-container" role="main"> | ||
| <div class="masthead clearfix"> | ||
| <div class="inner"> | ||
| <img width="150" alt="login.gov" class="masthead-brand" src="/images/logo-white.svg"> | ||
| </div> | ||
| </div> | ||
| <div class="inner cover"> | ||
| <h1>We're sorry, but something went wrong.</h1> | ||
| <p>Please try again in a few minutes. (406)</p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </body> | ||
| </html> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,20 +5,11 @@ | |
| let(:good_url_with_path) { 'http://example.com/asdf?qwerty=123' } | ||
| let(:bad_url) { 'http://evil.com/asdf/qwerty' } | ||
|
|
||
| let(:view_context) { ActionView::Base.new } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The presenter class only uses the view_context to access the request referer header, so I slightly refactored to pass that in directly instead of using the view context. |
||
|
|
||
| subject { described_class.new(view_context: view_context) } | ||
| subject { described_class.new(referer: referer_header) } | ||
|
|
||
| describe '#go_back_link' do | ||
| let(:sign_up_path) { '/two_factor_options' } | ||
|
|
||
| before do | ||
| allow(view_context).to receive(:sign_up_path).and_return(sign_up_path) | ||
| request = instance_double(ActionDispatch::Request) | ||
| allow(request).to receive(:env).and_return('HTTP_REFERER' => referer_header) | ||
| allow(view_context).to receive(:request).and_return(request) | ||
| end | ||
|
|
||
| context 'without a referer header' do | ||
| let(:referer_header) { nil } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where.notbeing NOR is deprecated and will become NAND in 6.1 (rails/rails#31209)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow that thread was a ride