Fixed #318 Allow multiple domains when using Google as OAuth provider (GRN-38) (#319)

* <Added muli_domain restriction with google_oauth>

* <Fixed code style>

* <Added some rspec tests>
This commit is contained in:
John Ma
2018-11-15 15:01:53 -05:00
committed by Jesus Federico
parent 1954ba4cff
commit efa9e08dfc
4 changed files with 46 additions and 5 deletions

View File

@ -143,6 +143,29 @@ describe UsersController, type: :controller do
end
end
describe "DELETE #user" do
before { allow(Rails.configuration).to receive(:allow_user_signup).and_return(true) }
it "properly deletes user" do
user = create(:user)
delete :destroy, params: { user_uid: user.uid }
expect(response).to redirect_to(root_path)
end
end
describe "GET | POST #terms" do
before { allow(Rails.configuration).to receive(:allow_user_signup).and_return(true) }
before { allow(Rails.configuration).to receive(:terms).and_return(false) }
it "Redirects to 404 if terms is disabled" do
post :terms, params: { accept: "false" }
expect(response).to redirect_to('/404')
end
end
describe "GET | POST #resend" do
before { allow(Rails.configuration).to receive(:allow_user_signup).and_return(true) }
before { allow(Rails.configuration).to receive(:enable_email_verification).and_return(true) }