-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change CI settings for support Ruby3.0+ Rails6.1+ (#357)
* Change CI settings for support Ruby3.0+ Rails6.1+ Now, Ruby 2.7 is EOL, and Rails 6.0 is also EOL. So I changed the CI settings to support only those higher versions. Fix #340 * Move rspec-rails development dependency to Gemfiles Since the supported version of rspec-rails depends on the version of rails we use, move the description to each Gemfile * Fix the following failure ``` Failures: 1) SorceryController with session timeout features with 'session_timeout_from_last_action' does not logout if there was activity Failure/Error: expect(response).to be_successful expected `#<ActionDispatch::TestResponse:0x0000557bab96c6d0 @mon_data=#<Monitor:0x0000557bab96c630>, @mon_data_...control={}, @request=#<ActionController::TestRequest GET "http://test.host/test_login" for 0.0.0.0>>.successful?` to return true, got false # ./spec/controllers/controller_session_timeout_spec.rb:146:in `block (4 levels) in <top (required)>' Finished in 2.52 seconds (files took 1.66 seconds to load) ``` [Starting with Rails 7.0, instance variables are reset between controller test requests](rails/rails#43735). This causes the second and subsequent requests to be judged as un-logged-in if there are no records in the DB. Putting a record in the DB fixes the failure. * Fix failures of specs due to a change in the keyword argument specification fix failing tests like the following ``` 1) SorceryController using create_from supports nested attributes Failure/Error: @user = user_class.create_from_provider(provider_name, @user_hash[:uid], attrs, &block) #<User(id: integer, username: string, email: string, crypted_password: string, salt: string, created_at: datetime, updated_at: datetime, activation_state: string, activation_token: string, activation_token_expires_at: datetime, last_login_at: datetime, last_logout_at: datetime, last_activity_at: datetime, last_login_from_ip_address: string) (class)> received :create_from_provider with unexpected arguments expected: ("facebook", "123", {:username=>"Haifa, Israel"}) (keyword arguments) got: ("facebook", "123", {:username=>"Haifa, Israel"}) (options hash) # ./lib/sorcery/controller/submodules/external.rb:194:in `create_from' # ./spec/rails_app/app/controllers/sorcery_controller.rb:456:in `test_create_from_provider' # ./spec/controllers/controller_oauth2_spec.rb:44:in `block (3 levels) in <top (required)>' ``` * Remove an useless spec A spec fails like the following in Rails 7.1 ``` 1) SorceryController when activated with sorcery #login when succeeds sets csrf token in session Failure/Error: expect(session[:_csrf_token]).not_to be_nil expected: not nil got: nil # ./spec/controllers/controller_spec.rb:68:in `block (5 levels) in <top (required)>' ``` Delete this because it didn't seem like a useful test. * Add Changelog * Readd rspec-rails to dev dependencies for running tests locally * Do not remove the csrf test * Gitignore new sqlite3 files * Add pending clause for Rails 7.1 for CSRF token --------- Co-authored-by: Josh Buker <crypto@joshbuker.com>
- Loading branch information
Showing
12 changed files
with
36 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'rails', '~> 6.0.0' | ||
gem 'rails', '~> 7.1.0' | ||
gem 'rails-controller-testing' | ||
gem 'sqlite3', '~> 1.4' | ||
|
||
gem 'rspec-rails', '>= 6.1' | ||
gemspec path: '..' |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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