-
-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51524e0
commit 18606cd
Showing
9 changed files
with
147 additions
and
26 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
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
33 changes: 33 additions & 0 deletions
33
spec/controllers/admin/account_requests_controller_spec.rb
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,33 @@ | ||
RSpec.describe Admin::AccountRequestsController, type: :controller do | ||
before do | ||
sign_in(create(:super_admin, organization: nil)) | ||
end | ||
|
||
let(:account_request) { create(:account_request) } | ||
let(:rejection_params) do | ||
{ | ||
account_request: { | ||
id: account_request.id, | ||
rejection_reason: "some rejection reason" | ||
} | ||
} | ||
end | ||
|
||
describe "POST #reject" do | ||
it "should reject the account request" do | ||
post :reject, params: rejection_params | ||
expect(account_request.reload).to be_rejected | ||
expect(flash[:notice]).to eq("Account request rejected!") | ||
expect(response).to redirect_to(admin_account_requests_path) | ||
end | ||
end | ||
|
||
describe "POST #close" do | ||
it "should close the account request" do | ||
post :close, params: rejection_params | ||
expect(account_request.reload).to be_admin_closed | ||
expect(flash[:notice]).to eq("Account request closed!") | ||
expect(response).to redirect_to(admin_account_requests_path) | ||
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
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