Skip to content

Commit

Permalink
Merge branch 'main' into io-to-file
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo authored Oct 22, 2024
2 parents 0d53031 + 11f8ddd commit 882a1e1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ gem 'delayed_job_heartbeat_plugin'
gem 'representable'

# Keyword search
gem 'keyword_search', '~> 1.5.0'
gem 'keyword_search'

# ToS/PP management
gem 'fine_print', github: 'lml/fine_print', ref: '636023f68e95196dffaf295bfad3ad8051c23542'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ DEPENDENCIES
jobba
jquery-rails
json-jwt
keyword_search (~> 1.5.0)
keyword_search
knockoutjs-rails
launchy
lev!
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/api/v1/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def get_sso_token(application, user)
access_token = Doorkeeper::AccessToken.find_or_create_for(
application: application,
resource_owner: user.id,
scopes: '',
scopes: Doorkeeper.config.default_scopes,
expires_in: SSO_TOKEN_INITIAL_DURATION,
use_refresh_token: false,
)
Expand All @@ -278,7 +278,7 @@ def get_sso_token(application, user)
access_token = Doorkeeper::AccessToken.create_for(
application: application.id,
resource_owner: user.id,
scopes: '',
scopes: Doorkeeper.config.default_scopes,
expires_in: SSO_TOKEN_INITIAL_DURATION,
use_refresh_token: false
)
Expand Down
2 changes: 1 addition & 1 deletion app/routines/search_users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def exec(query, options={})
]
)

KeywordSearch.search(query) do |with|
KeywordSearch.search(query || '') do |with|

with.default_keyword :any

Expand Down
6 changes: 6 additions & 0 deletions spec/controllers/api/v1/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@
let(:is_not_gdpr_location) { nil }

context "index" do
it "does not explode when called without params" do
api_get :index, trusted_application_token
expect(response.code).to eq('200')
expect(response.body_as_hash).to match({ total_count: User.count, items: [] })
end

it "returns a single result well" do
api_get :index, trusted_application_token, params: { q: 'first_name:bob last_name:Michaels' }
expect(response.code).to eq('200')
Expand Down

0 comments on commit 882a1e1

Please sign in to comment.