This file contains hidden or 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
| rack_input = env["rack.input"].read | |
| params = Rack::Utils.parse_query(rack_input, "&") |
This file contains hidden or 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
| :w !sudo tee % |
This file contains hidden or 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
| # Log the query plan for queries taking more than this (works | |
| # with SQLite, MySQL, and PostgreSQL) | |
| config.active_record.auto_explain_threshold_in_seconds = 0.5 |
This file contains hidden or 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
| #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) |
This file contains hidden or 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
| class ApplicationController < ActionController::Base | |
| rescue_from ActiveRecord::RecordNotFound, with: :handle_not_found | |
| private | |
| def handle_not_found | |
| # ... | |
| end | |
| end |
This file contains hidden or 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
| http://viget.com/extend/auto-saving-screenshots-on-test-failures-other-capybara-tricks | |
| http://www.elabs.se/blog/53-why-wait_until-was-removed-from-capybara | |
| http://blog.crowdint.com/2013/09/20/poltergeist-and-bootstrap-modals.html | |
| http://spin.atomicobject.com/2013/02/13/capybara-hidden-dom-elements/ | |
| http://blog.pixarea.com/2013/02/locking-the-firefox-version-when-testing-rails-with-capybara-and-selenium |
This file contains hidden or 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
| # Get the-1m.csv from Alexa http://www.alexa.com/topsites (right hand side of page) | |
| for i in `head -n 1000 top-1m.csv | cut -f2 -d,`; do | |
| echo "Site: $i"; | |
| diff <(curl --ipv4 -s -v --dns-servers 66.x.x.4,66.x.x.4 --url http://$i/ 2>&1 | grep -v "0x" | grep -v "Date: ") <(curl --ipv4 -s -v --dns-servers 8.8.8.8,8.8.4.4 --url http://$i/ 2>&1 | grep -v "0x" | grep -v "Date: "); | |
| done > 1000.diff.txt | |
This file contains hidden or 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
| Look at | |
| General Unit Testing | |
| Comment and Coding Conventions | |
| Error Handling | |
| Resource Leaks | |
| Thread Safety | |
| Control Structures | |
| Performance | |
| Functionality | |
| Security |
This file contains hidden or 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
| Spring.after_fork { FactoryGirl.reload } |
This file contains hidden or 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
| cache: bundler | |
| language: | |
| - ruby | |
| before_install: gem install bundler -v=1.5.1 | |
| install: | |
| - 'bundle install' | |
| rvm: | |
| - 1.9.3 | |
| - 2.0.0 | |
| - 2.1.0 |