Skip to content

Commit

Permalink
update specs
Browse files Browse the repository at this point in the history
  • Loading branch information
mwvolo committed Aug 8, 2024
1 parent b4dcb30 commit 7ddb5ac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions spec/factories/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
uuid {Faker::Alphanumeric.alphanumeric(number: 10, min_alpha: 3, min_numeric: 3)}
role { User::STUDENT_ROLE }
school { FactoryBot.build(:school) }
consent_preferences { JSON.generate({'accepted': ['functional', 'analytical'], 'rejected': ['essential', 'personalization']}) }

is_profile_complete { true }

Expand Down
4 changes: 2 additions & 2 deletions spec/representers/api/v1/user_representer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
end
end

context 'support_identifier' do
context 'consent_preferences' do
it 'can be read' do
expect(representer.to_hash['support_identifier']).to eq user.support_identifier
expect(representer.to_hash['consent_preferences']).to eq user.consent_preferences
end

it 'cannot be written (attempts are silently ignored)' do
Expand Down
3 changes: 1 addition & 2 deletions spec/support/user_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ def user_matcher(user, include_private_data: false)
first_name: user.first_name,
last_name: user.last_name,
full_name: user.full_name,
needs_complete_edu_profile: false,
title: user.title,
suffix: user.suffix,
uuid: user.uuid,
support_identifier: user.support_identifier,
consent_preferences: user.consent_preferences,
is_test: user.is_test?,
is_administrator: user.is_administrator?,
salesforce_contact_id: user.salesforce_contact_id,
Expand Down

0 comments on commit 7ddb5ac

Please sign in to comment.