You may request access to a hosted virtual machine with the command line shell.
<div style='display:inline-block'>
- <%= button_to('Send request for shell access', request_shell_access_user_url(id: current_user.uuid),
- id: 'request_shell_submit', class: 'btn btn-xs btn-primary', remote: true) %>
+ <%= link_to({action: 'request_shell_access', controller: 'users', id: current_user.uuid},
+ method: :post, remote: true, class: 'btn btn-xs btn-primary',
+ id: 'request_shell_submit', data: {disable_with: "Sending request..."}) do %>
+ Send request for shell access
+ <% end %>
</div>
</div><br/>
<div class='shell_access_requested alert alert-info'>
test "request shell access" do
visit page_with_token('spectator', '/manage_account')
assert_text 'You do not have access to any virtual machines'
- click_button 'Send request for shell access'
+ click_link 'Send request for shell access'
assert_text 'A request for shell access was sent.'
assert_no_text 'You do not have access to any virtual machines.'
+ assert_no_selector 'a', text: 'Send request for shell access'
# revisit the page and verify that the Request button is no longer shown
within('.navbar-fixed-top') do
end
assert_text 'You do not have access to any virtual machines.'
assert_text 'A request for shell access was sent on '
+ assert_selector 'a', text: 'Send request for shell access'
end
end