$ git branch --merged | awk '{ print $NF }' | xargs git branch -d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fizzBuzzToN = (n) => { | |
let array = [] | |
for ( let i = 1; i <= n ; i++){ | |
if ( i % 3 === 0 && i % 5 === 0) { | |
array.push("FizzBuzz") | |
} | |
else if ( i % 3 === 0) { | |
array.push("Fizz") | |
} | |
else if (i % 5 === 0){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AuthHelper | |
def sign_in_with_cookie(name, value) | |
case page.driver.class | |
when Capybara::RackTest::Driver | |
# Set session cookie using Rack::Test | |
page.driver.browser.env "rack.session", { name => value } | |
else | |
# Set session cookie using railsware/rack_session_access gem | |
page.set_rack_session(name => value) | |
end |