Skip to content

Commit

Permalink
release: bump version to v0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nejdetkadir committed Aug 8, 2023
1 parent e165ee0 commit e05f575
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
devise-api (0.1.2)
devise-api (0.1.3)
devise (>= 4.7.2)
dry-configurable (~> 1.0, >= 1.0.1)
dry-initializer (>= 3.1.1)
Expand Down
4 changes: 3 additions & 1 deletion app/controllers/devise/api/tokens_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# frozen_string_literal: true

# rubocop:disable Metrics/ClassLength
module Devise
module Api
class TokensController < Devise.api.config.base_controller.constantize
Expand All @@ -12,7 +13,7 @@ class TokensController < Devise.api.config.base_controller.constantize
def sign_up
unless Devise.api.config.sign_up.enabled
error_response = Devise::Api::Responses::ErrorResponse.new(request, error: :sign_up_disabled,
resource_class: resource_class)
resource_class: resource_class)

return render json: error_response.body, status: error_response.status
end
Expand Down Expand Up @@ -173,3 +174,4 @@ def current_devise_api_refresh_token
end
end
end
# rubocop:enable Metrics/ClassLength
2 changes: 1 addition & 1 deletion lib/devise/api/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Devise
module Api
VERSION = '0.1.2'
VERSION = '0.1.3'
end
end
10 changes: 5 additions & 5 deletions spec/devise/api/responses/error_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@

it 'has a body with an error and error description' do
allow(I18n).to receive(:t)
.with('devise.api.error_response.sign_up_disabled')
.and_return('Sign up is disabled')
.with('devise.api.error_response.sign_up_disabled')
.and_return('Sign up is disabled')

expect(error_response.body).to eq(
error: :sign_up_disabled,
error_description: ['Sign up is disabled']
)
error: :sign_up_disabled,
error_description: ['Sign up is disabled']
)

expect(I18n).to have_received(:t).with('devise.api.error_response.sign_up_disabled')
end
Expand Down
3 changes: 2 additions & 1 deletion spec/requests/tokens_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@
allow(Devise.api.config.before_refresh).to receive(:call).and_call_original
allow(Devise.api.config.after_successful_refresh).to receive(:call).and_call_original

post refresh_user_tokens_path, headers: authentication_headers_for(user, devise_api_token, :refresh_token), as: :json
post refresh_user_tokens_path, headers: authentication_headers_for(user, devise_api_token, :refresh_token),
as: :json
end

it 'returns http success' do
Expand Down

0 comments on commit e05f575

Please sign in to comment.