|
40 | 40 | OmniAuth.config.test_mode = true |
41 | 41 | OmniAuth.config.mock_auth[:default] = auth_hash |
42 | 42 |
|
43 | | - allow(Store::ReturnFromOneLoginStore).to receive(:new).and_wrap_original do |original_method, *_args| |
44 | | - original_method.call(store) |
45 | | - end |
46 | | - allow(Store::ConfirmationDetailsStore).to receive(:new).and_wrap_original do |original_method, *args| |
47 | | - original_method.call(store, args[1]) |
48 | | - end |
49 | | - allow(Store::AuthStore).to receive(:new).and_wrap_original do |original_method, *_args| |
| 43 | + allow(AuthService).to receive(:new).and_wrap_original do |original_method, *_args| |
50 | 44 | original_method.call(store) |
51 | 45 | end |
52 | 46 | end |
|
69 | 63 | end |
70 | 64 | end |
71 | 65 |
|
72 | | - context "when the auth details are not present on the request" do |
| 66 | + context "when data is missing on the auth details on the request" do |
73 | 67 | let(:auth_hash) { {} } |
74 | 68 |
|
75 | 69 | it "raises an OmniAuthLoggedInDataMissingError" do |
76 | | - expect { get omniauth_callback_path }.to raise_error(Users::OmniauthController::OmniAuthLoggedInDataMissingError) |
77 | | - end |
78 | | - end |
79 | | - |
80 | | - context "when the email on the auth hash is blank" do |
81 | | - let(:email) { "" } |
82 | | - |
83 | | - it "raises a OmniAuthLoggedInDataMissingError" do |
84 | | - expect { get omniauth_callback_path }.to raise_error(Users::OmniauthController::OmniAuthLoggedInDataMissingError) |
| 70 | + expect { get omniauth_callback_path }.to raise_error(AuthService::DataMissingError) |
85 | 71 | end |
86 | 72 | end |
87 | 73 |
|
|
107 | 93 | let(:token) { Faker::Alphanumeric.alphanumeric } |
108 | 94 |
|
109 | 95 | before do |
110 | | - allow(Store::ReturnFromOneLoginStore).to receive(:new).and_wrap_original do |original_method, *_args| |
111 | | - original_method.call(store) |
112 | | - end |
113 | | - allow(Store::AuthStore).to receive(:new).and_wrap_original do |original_method, *_args| |
| 96 | + allow(AuthService).to receive(:new).and_wrap_original do |original_method, *_args| |
114 | 97 | original_method.call(store) |
115 | 98 | end |
116 | 99 | end |
|
0 commit comments