|
|
|
@ -167,7 +167,8 @@ describe 'Enterprise trial management', |
|
|
|
|
expect(page).to have_no_text 'email sent - waiting for confirmation' |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'can request a new trial' do |
|
|
|
|
context 'with a waiting request pending' do |
|
|
|
|
before do |
|
|
|
|
proxy.stub('https://augur.openproject-edge.com:443/public/v1/trials', method: 'post') |
|
|
|
|
.and_return(headers: {'Access-Control-Allow-Origin' => '*'}, code: 200, body: created_body.to_json) |
|
|
|
|
|
|
|
|
@ -180,7 +181,33 @@ describe 'Enterprise trial management', |
|
|
|
|
|
|
|
|
|
expect(page).to have_text 'foo@foocorp.example' |
|
|
|
|
expect(page).to have_text 'email sent - waiting for confirmation' |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'can get the trial if reloading the page' do |
|
|
|
|
# We need to go to another page to stop the request cycle |
|
|
|
|
visit info_admin_index_path |
|
|
|
|
|
|
|
|
|
# Stub with successful body |
|
|
|
|
# Stub the proxy to a successful return |
|
|
|
|
# which marks the user has confirmed the mail link |
|
|
|
|
proxy.stub("https://augur.openproject-edge.com:443/public/v1/trials/#{trial_id}") |
|
|
|
|
.and_return(headers: {'Access-Control-Allow-Origin' => '*'}, code: 200, body: confirmed_body.to_json) |
|
|
|
|
|
|
|
|
|
# Stub the details URL to still return 403 |
|
|
|
|
proxy.stub("https://augur.openproject-edge.com:443/public/v1/trials/#{trial_id}/details") |
|
|
|
|
.and_return(headers: {'Access-Control-Allow-Origin' => '*'}, code: 403) |
|
|
|
|
|
|
|
|
|
visit enterprise_path |
|
|
|
|
|
|
|
|
|
expect(page).to have_selector('.attributes-key-value--value-container', text: 'OpenProject Test', wait: 20) |
|
|
|
|
expect(page).to have_selector('.attributes-key-value--value-container', text: '01/01/2020') |
|
|
|
|
expect(page).to have_selector('.attributes-key-value--value-container', text: '01/02/2020') |
|
|
|
|
expect(page).to have_selector('.attributes-key-value--value-container', text: '5') |
|
|
|
|
# Generated expired token has different mail |
|
|
|
|
expect(page).to have_selector('.attributes-key-value--value-container', text: 'info@openproject.com') |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it 'can confirm that trial regularly' do |
|
|
|
|
# Stub resend method |
|
|
|
|
proxy.stub("https://augur.openproject-edge.com:443/public/v1/trials/#{trial_id}/resend") |
|
|
|
|
.and_return(headers: {'Access-Control-Allow-Origin' => '*'}, code: 200, body: waiting_body.to_json) |
|
|
|
@ -214,4 +241,5 @@ describe 'Enterprise trial management', |
|
|
|
|
# Generated expired token has different mail |
|
|
|
|
expect(page).to have_selector('.attributes-key-value--value-container', text: 'info@openproject.com') |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|