Skip to content

Commit

Permalink
add assister signup specs
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulgudim committed Feb 16, 2025
1 parent f9afc0e commit 5313d6b
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def broker_denied_notification(broker_role)
def assister_denied_notification(assister_role)
return unless assister_role.email_address.present?

mail({to: assister_role.email_address, subject: "assister application denied"}) do |format|
mail({to: assister_role.email_address, subject: "Assister application denied"}) do |format|
format.html { render "broker_denied", :locals => { :applicant_name => assister_role.person.full_name }}
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def staff_index
@alph_labels = @page_alphabets.map{|alph| [alph.first, alph.last].join("–")} if EnrollRegistry.feature_enabled?(:bs4_consumer_flow)
page_no = cur_page_no(@page_alphabets.first)
@staff = if @q.nil?
@staff.where(last_name: /^#{Regexp.escape(page_no)}/i)
@staff.where(last_name: /^#{page_no}/i)
elsif @q.blank?
@staff.uniq.sort_by(&:last_name)
else
Expand Down
23 changes: 23 additions & 0 deletions features/hbx_admin/get_help_in_signup.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Feature: Get Help in Signing Up from Assister/Broker
Background:
Given bs4_consumer_flow feature is enabled
Given assister_agency feature is enabled
Given that a user with a HBX staff role with hbx_tier3 subrole exists
And Hbx Admin logs on to the Hbx Portal
And the Admin is on the Main Page
Given Hbx Admin Creates and Publish Individual market SEP Type
And Patrick Doe has active individual market role and verified identity

Scenario: Admin can view assisters and can select them
When an IVL Assister Agency exists
When Admin clicks Families tab
Then the Admin is navigated to the Families screen
And I click the name of Patrick Doe from family list
And clicks on #help_me_sign_up
And clicks on #bottom_expert_assister_link
Then assister record exists and should be able to click on the Select button
And should be able to click on the Select This Expert button
Then should be able to select the assister and see the success message



5 changes: 5 additions & 0 deletions features/insured/step_definitions/individual_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@
enable_feature :contrast_level_aa
end

When(/^assister_agency feature is enabled$/) do
allow(EnrollRegistry[:assister_agency].feature).to receive(:is_enabled).and_return(true)
enable_feature :assister_agency
end

When(/^bs4_consumer_flow feature is disable$/) do
disable_feature :bs4_consumer_flow
end
Expand Down
29 changes: 29 additions & 0 deletions features/step_definitions/help_me_sign_up_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
broker_agency_profile(broker_name).update_attributes!(aasm_state: 'is_approved', market_kind: 'individual', accept_new_clients: true)
end

Given(/^an IVL Assister Agency exists$/) do
assister_agency_profile = FactoryBot.create(:benefit_sponsors_organizations_assister_agency_profile)
assister_agency_profile.update_attributes!(aasm_state: 'is_approved', market_kind: 'individual', accept_new_clients: true)
FactoryBot.create(:assister_role, benefit_sponsors_assister_agency_profile_id: assister_agency_profile.id, aasm_state: 'active')
end

And(/Individual has broker assigned to them/) do
family = Family.first
broker_id = Person.where(:broker_role.exists => true).last.id
Expand All @@ -19,6 +25,29 @@
find('.interaction-click-control-help-me-sign-up').click unless EnrollRegistry[:bs4_consumer_flow].enabled?
end

And("clicks on #help_me_sign_up") do
find("#help_me_sign_up").click
end

And("clicks on #bottom_expert_assister_link") do
find("#bottom_expert_assister_link").click
end

Then("assister record exists and should be able to click on the Select button") do
within("#assister_index_view") do
expect(page).to have_css("tbody tr", count: 1)
find(".assister_select_button").click
end
end

And("should be able to click on the Select This Expert button") do
find("button.select-broker").click
end

Then("should be able to select the assister and see the success message") do
expect(page).to have_css(".alert-success", text: "You have successfully selected this expert")
end

And(/^Individual clicks on the Get Help Signing Up button?/) do
find(".interaction-click-control-get-help-signing-up").click
end
Expand Down

0 comments on commit 5313d6b

Please sign in to comment.