diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-10-06 17:14:14 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-10-06 17:14:14 +0300 |
commit | f9d490dbb910cdd05ca0a0fa38331708181e4b1e (patch) | |
tree | 0329bd87db08ee068d816646adfd48f8b623d608 /spec/controllers/google_api | |
parent | 3e26b0dcd113ade77dc8304137c6733cab4c8718 (diff) |
Improve redirect uri state and fix all remaining tests
Diffstat (limited to 'spec/controllers/google_api')
-rw-r--r-- | spec/controllers/google_api/authorizations_controller_spec.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/spec/controllers/google_api/authorizations_controller_spec.rb b/spec/controllers/google_api/authorizations_controller_spec.rb index 253cfab64d1..80d553f0f34 100644 --- a/spec/controllers/google_api/authorizations_controller_spec.rb +++ b/spec/controllers/google_api/authorizations_controller_spec.rb @@ -24,20 +24,19 @@ describe GoogleApi::AuthorizationsController do .to eq(expires_at) end - context 'when second redirection url key is stored in state' do + context 'when redirect uri key is stored in state' do set(:project) { create(:project) } - let(:second_redirect_uri) { project_clusters_url(project).to_s } + let(:redirect_uri) { project_clusters_url(project).to_s } before do - GoogleApi::CloudPlatform::Client - .session_key_for_second_redirect_uri.tap do |key, secure| - @state = secure - session[key] = second_redirect_uri + @state = GoogleApi::CloudPlatform::Client + .new_session_key_for_redirect_uri do |key| + session[key] = redirect_uri end end it 'redirects to the URL stored in state param' do - expect(subject).to redirect_to(second_redirect_uri) + expect(subject).to redirect_to(redirect_uri) end end |