Skip to content

Instantly share code, notes, and snippets.

@ershad
ershad / query_finder.sql
Created February 1, 2019 22:14 — forked from mezis/query_finder.sql
Finding long-running queries in MySQL
SELECT id,state,command,time,left(replace(info,'\n','<lf>'),120)
FROM information_schema.processlist
WHERE command <> 'Sleep'
AND info NOT LIKE '%PROCESSLIST%'
ORDER BY time DESC LIMIT 50;
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
no change in User#usertype
def present_user
user_signed_in? ? current_user : non_logged_in_user
end
def non_logged_in_user
unverified_user_undo? ? unverified_user : User.new
end