Feature/1784 - All users recieve account activation SMS#3621
Conversation
…er dynamic notifications for different types of users
|
Please fix lint and the tests :) |
|
Please fit the git conflicts :) |
ok, will do |
|
50% done issue. Still working. Will fix and refactor tests, lints, you name it near the end |
|
Also there are some git conflicts to resolve... |
…bmock helper probably because of merge issues
yes, I will work on the conflicts asap. Once everything is good, I'll open this issue. |
| } | ||
| ) | ||
| .to_return(status: 200, body: "", headers: {}) | ||
| module TwilioAPI |
There was a problem hiding this comment.
Can we put these stubbed request modules in their own files for easier maintainability?
There was a problem hiding this comment.
so instead of modules, you want to put twilio stubs and short io stubs into their own separate files?
There was a problem hiding this comment.
I believe we can still have them as modules but have a hierarchy as follows for clarity and seperation:
-- support
-- subbed_requests
-- twilio_api.rb
-- short_io_api.rb
A file such as twilio_api.rb would look like this:
# twilio_api.rb
module StubbedRequests
module TwilioAPI
def self.allowed_sites(blacklist)
lambda { |uri|
blacklist.none? { |site| uri.host.include?(site) }
}
end
# stubs
end
endThere was a problem hiding this comment.
I like that idea. Very clear.
|
fixed codeclimate issue and rspec tests are passing. Before I lint and open this issue for review, I will do the following:
|
…redirect user to correct page
…nil are also handled
| # updated_at :datetime not null | ||
| # casa_org_id :bigint not null | ||
| # invited_by_id :bigint | ||
| # invited_by_id :integer |
There was a problem hiding this comment.
these extraneous comment changes are not ideal but they are common. Don't worry about them for now.
There was a problem hiding this comment.
thats weird.. i never touched any model files
|
|
||
| RSpec.describe "/casa_admins", type: :request do | ||
| # stub the domains within blacklist for testing | ||
| blacklist = ["api.twilio.com", "api.short.io"] |
There was a problem hiding this comment.
TODO replace all "blacklist" with "disallowlist"

What github issue is this PR for, if any?
Resolves #1784
What changed, and why?
To do (features)
How is this tested? (please write tests!) 💖💪
Screenshots please :)
Here is an example of a supervisor created successfully with a SMS sent.


Here is a case when the user makes a typo in their phone number. User still gets created, but SMS not sent.

Feelings gif (optional)
My 💰 don't 🤹 🤹 it folds

Feedback please? (optional)
We are very interested in your feedback! Please give us some :) https://forms.gle/1D5ACNgTs2u9gSdh9