-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adds contactable consent field to user model updates related functionality (filter, strong params) for updated user model adds test cases to users model and users requests updates error handling in lib/gems/baw-app/lib/types.rb autoformat **only** changes: spec/factories/user_factory.rb spec/controllers/user_accounts_controller_spec.rb * addresses PR comments changes values of consent enum Fixes #692
- Loading branch information
1 parent
bdf451e
commit a8084b5
Showing
10 changed files
with
269 additions
and
131 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 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddContactableToUsers < ActiveRecord::Migration[7.2] | ||
def change | ||
create_enum :consent, ['unasked', 'yes', 'no'] | ||
add_column :users, :contactable, :enum, enum_type: :consent, default: 'unasked', null: false, | ||
comment: 'Is the user contactable for email communications' | ||
end | ||
end |
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# make sure it can recover from bad input | ||
describe 'proper timezones data' do | ||
let(:user_bad_tz) { | ||
user = FactoryBot.build(:user, tzinfo_tz: 'Australia - Sydney', rails_tz: 'Sydney') | ||
user = build(:user, tzinfo_tz: 'Australia - Sydney', rails_tz: 'Sydney') | ||
user.save!(validate: false) | ||
user | ||
} | ||
|
@@ -55,7 +55,7 @@ | |
|
||
describe 'bad timezones data' do | ||
let(:user_bad_tz) { | ||
user = FactoryBot.build(:user, tzinfo_tz: '[email protected]', rails_tz: '[email protected]') | ||
user = build(:user, tzinfo_tz: '[email protected]', rails_tz: '[email protected]') | ||
user.save!(validate: false) | ||
user | ||
} | ||
|
@@ -71,7 +71,7 @@ | |
response = get :my_account, params: { format: :json } | ||
body = JSON.parse(response.body) | ||
|
||
expect(body['timezone_information']).to be(nil) | ||
expect(body['timezone_information']).to be_nil | ||
|
||
user_good_tz = User.find(user_bad_tz.id) | ||
new_values = [user_good_tz.tzinfo_tz, user_good_tz.rails_tz] | ||
|
Oops, something went wrong.