diff --git a/src/oc-id/Gemfile b/src/oc-id/Gemfile index f3e169444b..c14057db8f 100644 --- a/src/oc-id/Gemfile +++ b/src/oc-id/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '~> 7.0.4' +gem 'rails', '~> 7.1.3' gem 'chef', '17.10.0' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.11' @@ -13,7 +13,7 @@ gem 'rb-readline', '~> 0.5.2', require: false gem 'sass-rails', '>= 4.0.3' gem 'turbolinks', '~> 5' gem 'unicorn-rails', '~> 2.2', '>= 2.2.1' -gem 'nokogiri', '1.14.3' +gem 'nokogiri', '1.16.6' gem 'pg', '>= 0.18', '< 2.0' # active_record 4.2.8 pins this but doesn't manifest this in the gemspec for some reason gem 'mixlib-authentication', '>= 2.1', '< 4' gem 'responders', '~> 3.0', '>= 3.0.1' @@ -57,7 +57,7 @@ end group :test do gem 'capybara', '~> 3.39' - gem 'factory_girl_rails', '~> 4.9.0' + gem 'factory_bot_rails', '~> 6.4' gem 'selenium-webdriver', '~> 4.7.1' gem 'timecop' end diff --git a/src/oc-id/Gemfile.lock b/src/oc-id/Gemfile.lock index 2137264bab..3c3ffdf0b2 100644 --- a/src/oc-id/Gemfile.lock +++ b/src/oc-id/Gemfile.lock @@ -1,72 +1,80 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + zeitwerk (~> 2.6) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.4.3) - actionpack (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activesupport (= 7.0.4.3) + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp - rails-dom-testing (~> 2.0) - actionpack (7.0.4.3) - actionview (= 7.0.4.3) - activesupport (= 7.0.4.3) - rack (~> 2.0, >= 2.2.0) + rails-dom-testing (~> 2.2) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4.3) - actionpack (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4.3) - activesupport (= 7.0.4.3) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.4.3) - activesupport (= 7.0.4.3) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.3.6) - activemodel (7.0.4.3) - activesupport (= 7.0.4.3) - activerecord (7.0.4.3) - activemodel (= 7.0.4.3) - activesupport (= 7.0.4.3) - activestorage (7.0.4.3) - actionpack (= 7.0.4.3) - activejob (= 7.0.4.3) - activerecord (= 7.0.4.3) - activesupport (= 7.0.4.3) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) + timeout (>= 0.4.0) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (7.0.4.3) + activesupport (7.1.3.4) + base64 + bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) minitest (>= 5.1) + mutex_m tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) aws-eventstream (1.2.0) @@ -88,6 +96,7 @@ GEM aws-sigv4 (~> 1.1) aws-sigv4 (1.5.2) aws-eventstream (~> 1, >= 1.0.2) + base64 (0.2.0) bcrypt (3.1.18) better_errors (2.9.1) coderay (>= 1.0.0) @@ -96,7 +105,7 @@ GEM bigdecimal (3.1.3) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - builder (3.2.4) + builder (3.3.0) byebug (11.1.3) capybara (3.39.2) addressable @@ -166,20 +175,22 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.2.2) + concurrent-ruby (1.3.3) config (4.1.0) deep_merge (~> 1.2, >= 1.2.1) dry-validation (~> 1.0, >= 1.0.0) + connection_pool (2.4.1) corefoundation (0.3.13) ffi (>= 1.15.0) crass (1.0.6) daemons (1.4.1) - date (3.3.3) + date (3.3.4) debug_inspector (1.1.0) deep_merge (1.2.2) diff-lcs (1.5.0) doorkeeper (5.6.6) railties (>= 5) + drb (2.2.1) dry-configurable (1.0.1) dry-core (~> 1.0, < 2) zeitwerk (~> 2.6) @@ -212,15 +223,15 @@ GEM dry-initializer (~> 3.0) dry-schema (>= 1.12, < 2) zeitwerk (~> 2.6) - erubi (1.12.0) + erubi (1.13.0) erubis (2.7.0) eventmachine (1.2.7) execjs (2.8.1) - factory_girl (4.9.0) - activesupport (>= 3.0.0) - factory_girl_rails (4.9.0) - factory_girl (~> 4.9.0) - railties (>= 3.0.0) + factory_bot (6.4.6) + activesupport (>= 5.0.0) + factory_bot_rails (6.4.3) + factory_bot (~> 6.4) + railties (>= 5.0.0) faraday (1.3.1) faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) @@ -232,8 +243,8 @@ GEM ffi-yajl (2.4.0) libyajl2 (>= 1.2) fuzzyurl (0.9.0) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) gssapi (1.3.1) ffi (>= 1.0.1) gyoku (1.4.0) @@ -245,7 +256,7 @@ GEM tilt hashie (4.1.0) httpclient (2.8.3) - i18n (1.13.0) + i18n (1.14.5) concurrent-ruby (~> 1.0) iniparse (1.5.0) inspec-core (4.24.32) @@ -270,7 +281,11 @@ GEM train-core (~> 3.0) tty-prompt (~> 0.17) tty-table (~> 0.10) + io-console (0.7.2) ipaddress (0.8.3) + irb (1.14.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) @@ -292,9 +307,9 @@ GEM logging (2.3.1) little-plugger (~> 1.1) multi_json (~> 1.14) - loofah (2.20.0) + loofah (2.22.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) mail (2.8.1) mini_mime (>= 0.1.1) net-imap @@ -310,11 +325,12 @@ GEM skinny (>= 0.1.2) sqlite3-ruby thin - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) + method_source (1.1.0) mini_mime (1.1.5) - minitest (5.18.0) + mini_portile2 (2.8.7) + minitest (5.24.1) mixlib-archive (1.1.7) mixlib-log mixlib-authentication (3.0.10) @@ -328,22 +344,24 @@ GEM multipart-post (2.3.0) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) - net-imap (0.3.4) + mutex_m (0.2.0) + net-imap (0.4.14) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout net-scp (4.0.0) net-ssh (>= 2.6.5, < 8.0.0) net-sftp (3.0.0) net-ssh (>= 5.0.0, < 7.0.0) - net-smtp (0.3.3) + net-smtp (0.5.0) net-protocol net-ssh (6.1.0) - nio4r (2.5.9) - nokogiri (1.14.3) + nio4r (2.7.3) + nokogiri (1.16.6) + mini_portile2 (~> 2.8.2) racc (~> 1.4) nori (2.6.0) ohai (17.9.1) @@ -383,49 +401,58 @@ GEM psych (5.1.0) stringio public_suffix (5.0.3) - nio4r (~> 2.0) - racc (1.7.1) - rack (2.2.8) + racc (1.8.0) + rack (2.2.9) rack-protection (3.0.6) rack + rack-session (1.0.2) + rack (< 3) rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4.3) - actioncable (= 7.0.4.3) - actionmailbox (= 7.0.4.3) - actionmailer (= 7.0.4.3) - actionpack (= 7.0.4.3) - actiontext (= 7.0.4.3) - actionview (= 7.0.4.3) - activejob (= 7.0.4.3) - activemodel (= 7.0.4.3) - activerecord (= 7.0.4.3) - activestorage (= 7.0.4.3) - activesupport (= 7.0.4.3) + rackup (1.0.0) + rack (< 3) + webrick + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) bundler (>= 1.15.0) - railties (= 7.0.4.3) + railties (= 7.1.3.4) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) - railties (7.0.4.3) - actionpack (= 7.0.4.3) - activesupport (= 7.0.4.3) - method_source + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) + irb + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) raindrops (0.20.1) - rake (13.0.6) + rake (13.2.1) rb-readline (0.5.5) rdoc (6.5.0) psych (>= 4.0.0) regexp_parser (2.8.1) + reline (0.5.9) + io-console (~> 0.5) responders (3.1.0) actionpack (>= 5.2) railties (>= 5.2) @@ -508,10 +535,10 @@ GEM daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - thor (1.2.1) + thor (1.3.1) tilt (2.1.0) timecop (0.9.6) - timeout (0.3.2) + timeout (0.4.1) tomlrb (1.3.0) train-core (3.10.7) addressable (~> 2.5) @@ -567,7 +594,7 @@ GEM pbkdf2 webrick (1.8.1) websocket (1.2.9) - websocket-driver (0.7.5) + websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) winrm (2.3.6) @@ -592,7 +619,7 @@ GEM wmi-lite (1.0.7) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.7) + zeitwerk (2.6.16) PLATFORMS ruby @@ -606,17 +633,17 @@ DEPENDENCIES coffee-rails (~> 5.0) config (~> 4.1) doorkeeper (~> 5.0) - factory_girl_rails (~> 4.9.0) + factory_bot_rails (~> 6.4) jbuilder (~> 2.11) jquery-rails jwt mailcatcher mixlib-authentication (>= 2.1, < 4) - nokogiri (= 1.14.3) + nokogiri (= 1.16.6) omniauth-chef (~> 0.4) pg (>= 0.18, < 2.0) pry-byebug - rails (~> 7.0.4) + rails (~> 7.1.3) rails-controller-testing rb-readline (~> 0.5.2) responders (~> 3.0, >= 3.0.1) diff --git a/src/oc-id/config/settings.yml b/src/oc-id/config/settings.yml index 268123f2a4..7b5f38593a 100644 --- a/src/oc-id/config/settings.yml +++ b/src/oc-id/config/settings.yml @@ -1,6 +1,7 @@ chef: endpoint: https://192.168.33.100 superuser: pivotal + ssl_verify_mode: verify_none doorkeeper: administrators: - rainbowdash diff --git a/src/oc-id/spec/controllers/oauth_controllers_spec.rb b/src/oc-id/spec/controllers/oauth_controllers_spec.rb index c75575f289..0aec8f943f 100644 --- a/src/oc-id/spec/controllers/oauth_controllers_spec.rb +++ b/src/oc-id/spec/controllers/oauth_controllers_spec.rb @@ -1,7 +1,8 @@ -require 'factory_girl' +require 'factory_bot' require 'spec_helper' describe Doorkeeper::ApplicationsController do + render_views describe '#index' do before do allow(Settings).to receive_message_chain(:doorkeeper, :administrators).and_return(['rainbowdash']) @@ -16,7 +17,7 @@ end context 'as a signed-in non-administrator' do - let(:user) { FactoryGirl.build(:user) } + let(:user) { FactoryBot.build(:user) } it 'should respond with a 404' do expect(response.status).to be(404) @@ -24,7 +25,7 @@ end context 'as a signed-in administrator' do - let(:user) { FactoryGirl.build(:administrator) } + let(:user) { FactoryBot.build(:administrator) } it 'should respond with a 200' do expect(response.status).to be(200) diff --git a/src/oc-id/spec/controllers/password_resets_controller_spec.rb b/src/oc-id/spec/controllers/password_resets_controller_spec.rb index 8627458b56..6bf4261e55 100644 --- a/src/oc-id/spec/controllers/password_resets_controller_spec.rb +++ b/src/oc-id/spec/controllers/password_resets_controller_spec.rb @@ -2,6 +2,8 @@ require 'timecop' describe PasswordResetsController do + render_views + describe 'GET #new' do before { get :new } diff --git a/src/oc-id/spec/controllers/profiles_controller_spec.rb b/src/oc-id/spec/controllers/profiles_controller_spec.rb index a4ab70e19c..cead20af45 100644 --- a/src/oc-id/spec/controllers/profiles_controller_spec.rb +++ b/src/oc-id/spec/controllers/profiles_controller_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe ProfilesController do + render_views + let(:username) { 'jimmy' } let(:email) { 'jim.kirk@federation-captains.org' } let(:user1) do diff --git a/src/oc-id/spec/controllers/zendesks_controller_spec.rb b/src/oc-id/spec/controllers/zendesks_controller_spec.rb index 708bb52c02..088b18c734 100644 --- a/src/oc-id/spec/controllers/zendesks_controller_spec.rb +++ b/src/oc-id/spec/controllers/zendesks_controller_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe ZendesksController do + render_views + describe '#show' do context 'when zendesk is enabled' do before :each do diff --git a/src/oc-id/spec/requests/authentication_pages_spec.rb b/src/oc-id/spec/requests/authentication_pages_spec.rb index 4d0c255964..71f2cf3554 100644 --- a/src/oc-id/spec/requests/authentication_pages_spec.rb +++ b/src/oc-id/spec/requests/authentication_pages_spec.rb @@ -14,7 +14,7 @@ it { should have_link 'Sign Up' } describe 'success' do - let(:user) { FactoryGirl.build(:user) } + let(:user) { FactoryBot.build(:user) } before do fill_in 'username', :with => user.username @@ -36,7 +36,7 @@ end describe 'success with email' do - let(:user) { FactoryGirl.build(:user) } + let(:user) { FactoryBot.build(:user) } before do fill_in 'username', :with => user.email @@ -58,7 +58,7 @@ end describe 'failure' do - let(:user) { FactoryGirl.build(:user) } + let(:user) { FactoryBot.build(:user) } before do fill_in 'username', :with => user.username diff --git a/src/oc-id/spec/support/factories.rb b/src/oc-id/spec/support/factories.rb index 12d46559ef..3be5cf6efa 100644 --- a/src/oc-id/spec/support/factories.rb +++ b/src/oc-id/spec/support/factories.rb @@ -1,13 +1,13 @@ -require 'factory_girl' +require 'factory_bot' -FactoryGirl.define do +FactoryBot.define do factory :user do - username 'applejack' - password 'password' - first_name 'Apple' - last_name 'Jack' - email 'applejack@ponyville.com' - public_key %Q{-----BEGIN PUBLIC KEY----- + username {'applejack'} + password {'password'} + first_name {'Apple'} + last_name {'Jack'} + email {'applejack@ponyville.com'} + public_key {%Q{-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv8QZxdp5XQVGnpHgPdRn MeHghbzDW/D6oAcXT6spfqN+5T7W/TruYpJbL+9cDfrIoNW8YOvHhDp0yoHl/YNl ZX0bYltdgZer10/Yv9PoB2U4TAzajBcd3DF3TxiB1sBPxqLvcF30CkmPpq4lmsNs @@ -15,16 +15,16 @@ SzQ2i3KSq450nfaX0p4dnRq5cq7/qW+Yr11lRByTIq6j8qEwPJNIXsUwIDWab8fr F6dutenFO3xjG+s12x8iU8MQLzsBMtFa9V1hr189xqUwAW0DBoiKBXjkQ20DKC/T SQIDAQAB ------END PUBLIC KEY-----} +-----END PUBLIC KEY-----}} end factory :administrator, parent: :user do - username 'rainbowdash' - password 'password' - first_name 'Rainbow' - last_name 'Dash' - email 'rainbowdash@ponyville.com' - public_key %Q{-----BEGIN PUBLIC KEY----- + username {'rainbowdash'} + password {'password'} + first_name {'Rainbow'} + last_name {'Dash'} + email {'rainbowdash@ponyville.com'} + public_key {%Q{-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv8QZxdp5XQVGnpHgPdRn MeHghbzDW/D6oAcXT6spfqN+5T7W/TruYpJbL+9cDfrIoNW8YOvHhDp0yoHl/YNl ZX0bYltdgZer10/Yv9PoB2U4TAzajBcd3DF3TxiB1sBPxqLvcF30CkmPpq4lmsNs @@ -32,6 +32,6 @@ SzQ2i3KSq450nfaX0p4dnRq5cq7/qW+Yr11lRByTIq6j8qEwPJNIXsUwIDWab8fr F6dutenFO3xjG+s12x8iU8MQLzsBMtFa9V1hr189xqUwAW0DBoiKBXjkQ20DKC/T SQIDAQAB ------END PUBLIC KEY-----} +-----END PUBLIC KEY-----}} end end