Skip to content

Commit

Permalink
feat: upgrade bcrypt gem to allow devise passwords to work on Ubuntu 20+
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomarrocoli committed Oct 7, 2022
1 parent 7ecbba4 commit f03a459
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ gem 'slack-notifier', '~> 1.5.1'
# Authentication and Authorization
gem 'cancancan', '~> 1.10'
gem 'devise', '~> 4.2.0'
gem 'bcrypt', '~> 3.1.17' # Required on Ubuntu 20+

# Background jobs
gem 'redis', '~> 3.3.1'
Expand Down
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ GEM
rack
thread_safe
arel (6.0.3)
bcrypt (3.1.11)
bcrypt (3.1.18)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
browserify-rails (3.1.0)
Expand Down Expand Up @@ -265,6 +265,7 @@ DEPENDENCIES
activerecord-session_store (~> 1.1)
annotate (~> 2.7.1)
appsignal (~> 1.1.9)
bcrypt (~> 3.1.17)
browserify-rails (~> 3.1.0)
byebug
cancancan (~> 1.10)
Expand Down
13 changes: 12 additions & 1 deletion test/controllers/reports_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,18 @@ class ReportsControllerTest < ActionController::TestCase
end

test "should search for reports by date range" do
@report = FactoryGirl.create(:report, created_at: Date.today- 1.day)
@report = FactoryGirl.create(:report)
date = Date.today - 1.day
date_of_discovery = {
'answers': {
'date_of_discovery': {
'selected': date.strftime('%d/%m/%Y')
}
}
}
report_data = @report.data
@report.update(data: report_data.merge(date_of_discovery))

date_f = Date.today - 2.days
date_t = Date.today - 1.day
from_date = {"(1i)": date_f.year, "(2i)": date_f.month, "(3i)": date_f.day}
Expand Down

0 comments on commit f03a459

Please sign in to comment.