Skip to content

Instantly share code, notes, and snippets.

View itumoraes's full-sized avatar

Italo Moraes Santiago itumoraes

View GitHub Profile
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active December 13, 2024 03:17
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@dreamstarter
dreamstarter / Javascript - Simple email validation
Last active March 27, 2024 16:24
Javascript - Use a regex to check the email address input.
function checkEmail(email) {
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if (!reg.test(email)) return false;
return true;
}
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=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')