-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "Search for Payroll Provider" button to employer search page
For situations when Pinwheel doesn't return the employer matches, this commit adds a button to the bottom of the employer search page (only visible after a search is performed) that opens the default Pinwheel modal.
- Loading branch information
Showing
5 changed files
with
76 additions
and
4 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,41 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Api::PinwheelController do | ||
include PinwheelApiHelper | ||
|
||
context "#create_token" do | ||
let(:cbv_flow) { CbvFlow.create(case_number: "TEST123") } | ||
let(:valid_params) do | ||
{ | ||
pinwheel: { response_type: "employer", id: "123" } | ||
} | ||
end | ||
|
||
before do | ||
session[:cbv_flow_id] = cbv_flow.id | ||
stub_create_token_response | ||
end | ||
|
||
it "creates a link token with Pinwheel" do | ||
post :create_token, params: valid_params | ||
|
||
expect(JSON.parse(response.body)) | ||
.to include("token" => be_a(String)) | ||
end | ||
|
||
describe "when the button is pressed without an employer or ID" do | ||
let(:valid_params) do | ||
{ | ||
pinwheel: { response_type: "", id: "" } | ||
} | ||
end | ||
|
||
it "still creates a link token with Pinwheel" do | ||
post :create_token, params: valid_params | ||
|
||
expect(JSON.parse(response.body)) | ||
.to include("token" => be_a(String)) | ||
end | ||
end | ||
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